Skip to content

Commit

Permalink
Some JP splits and decomp (#1116)
Browse files Browse the repository at this point in the history
* Some work

* Fix build

* PR comments

* symbol renames

---------

Co-authored-by: Ethan Roseman <[email protected]>
  • Loading branch information
JoshDuMan and ethteck authored Oct 14, 2023
1 parent ce4ab34 commit 84185a1
Show file tree
Hide file tree
Showing 10 changed files with 1,010 additions and 291 deletions.
11 changes: 11 additions & 0 deletions src/77480.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
#define i_spy_VRAM (void*)0x802B7000
#endif

#if VERSION_JP // TODO remove once segments are split
extern Addr i_spy_ROM_START;
extern Addr i_spy_ROM_END;
extern Addr pulse_stone_ROM_START;
extern Addr pulse_stone_ROM_END;
extern Addr speech_bubble_ROM_START;
extern Addr speech_bubble_ROM_END;
extern Addr inspect_icon_ROM_START;
extern Addr inspect_icon_ROM_END;
#endif

SHIFT_BSS UNK_FUN_PTR(ISpyNotificationCallback);
SHIFT_BSS UNK_FUN_PTR(PulseStoneNotificationCallback);
SHIFT_BSS UNK_FUN_PTR(TalkNotificationCallback);
Expand Down
2 changes: 2 additions & 0 deletions src/7bb60_len_41b0.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,9 @@ void phys_main_collision_below(void) {
break;
}
} else if (!(playerStatus->flags & PS_FLAG_FLYING)
#ifndef VERSION_JP
&& playerStatus->actionState != ACTION_STATE_USE_SPINNING_FLOWER
#endif
) {
if (outLength <= collHeightHalf + temp_f24 && hitDirX == 0.0f && hitDirZ == 0.0f) {
set_action_state(ACTION_STATE_STEP_DOWN);
Expand Down
11 changes: 10 additions & 1 deletion src/7fd10_len_b40.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ void check_input_open_menus(void) {
do {
use_consumable(popup->userIndex[D_8010CCFC - 1]);
} while (0); // todo required to match
#ifndef VERSION_JP
gOverrideFlags |= GLOBAL_OVERRIDES_CANT_PICK_UP_ITEMS;
#endif
break;
}
}
Expand Down Expand Up @@ -386,16 +388,23 @@ void check_input_status_bar(void) {
if (!(playerStatus->curButtons & (Z_TRIG | R_TRIG)) && (pressedButtons & BUTTON_C_UP) && func_800E9860()) {
open_status_bar_long();

#if VERSION_JP
sfx_play_sound(SOUND_LOWER_STATUS_BAR);
#else
if (!is_picking_up_item()) {
sfx_play_sound(SOUND_LOWER_STATUS_BAR);
}
#endif
}
} else if (!(playerStatus->curButtons & (Z_TRIG | R_TRIG)) && (pressedButtons & BUTTON_C_UP) && func_800E9860()) {
close_status_bar();

#if VERSION_JP
sfx_play_sound(SOUND_RAISE_STATUS_BAR);
#else
if (!is_picking_up_item()) {
sfx_play_sound(SOUND_RAISE_STATUS_BAR);
}
#endif
}
}
}
39 changes: 39 additions & 0 deletions src/world/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,45 @@ void action_update_use_munchlesia(void);
void action_update_use_tweester(void);
void action_update_state_23(void);

#if VERSION_JP // TODO remove once segments are split
extern Addr world_action_idle_ROM_START;
extern Addr world_action_idle_ROM_END;
extern Addr world_action_walk_ROM_START;
extern Addr world_action_walk_ROM_END;
extern Addr world_action_jump_ROM_START;
extern Addr world_action_jump_ROM_END;
extern Addr world_action_land_ROM_START;
extern Addr world_action_land_ROM_END;
extern Addr world_action_misc_ROM_START;
extern Addr world_action_misc_ROM_END;
extern Addr world_action_spin_jump_ROM_START;
extern Addr world_action_spin_jump_ROM_END;
extern Addr world_action_tornado_jump_ROM_START;
extern Addr world_action_tornado_jump_ROM_END;
extern Addr world_action_slide_ROM_START;
extern Addr world_action_slide_ROM_END;
extern Addr world_action_hammer_ROM_START;
extern Addr world_action_hammer_ROM_END;
extern Addr world_action_hit_fire_ROM_START;
extern Addr world_action_hit_fire_ROM_END;
extern Addr world_action_knockback_ROM_START;
extern Addr world_action_knockback_ROM_END;
extern Addr world_action_hit_lava_ROM_START;
extern Addr world_action_hit_lava_ROM_END;
extern Addr world_action_step_up_ROM_START;
extern Addr world_action_step_up_ROM_END;
extern Addr world_action_sneaky_parasol_ROM_START;
extern Addr world_action_sneaky_parasol_ROM_END;
extern Addr world_action_spin_ROM_START;
extern Addr world_action_spin_ROM_END;
extern Addr world_action_use_spinning_flower_ROM_START;
extern Addr world_action_use_spinning_flower_ROM_END;
extern Addr world_action_use_munchlesia_ROM_START;
extern Addr world_action_use_munchlesia_ROM_END;
extern Addr world_action_use_tweester_ROM_START;
extern Addr world_action_use_tweester_ROM_END;
#endif

s32 PrevPlayerCamRelativeYaw = 0;
s32 D_800F7B44 = 0;
f32 D_800F7B48 = 0.0f;
Expand Down
2 changes: 1 addition & 1 deletion src/world/area_end/common/Credits.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#define STANDARD_POS_X 160

#ifdef VERSION_PAL
#if VERSION_PAL
#define STANDARD_APPEAR_TIME 33
#define STANDARD_HOLD_TIME 116
#define STANDARD_VANISH_TIME 25
Expand Down
43 changes: 43 additions & 0 deletions src/world/partners.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,45 @@ extern HudScript HES_StatusSPIncrement7;

extern EvtScript EVS_World_UseItem;

#if VERSION_JP // TODO remove once segments are split
extern Addr world_use_item_ROM_START;
extern Addr world_use_item_ROM_END;
extern Addr world_use_item_VRAM;
extern Addr world_partner_goombario_ROM_START;
extern Addr world_partner_goombario_ROM_END;
extern Addr world_partner_goombario_VRAM;
extern Addr world_partner_kooper_ROM_START;
extern Addr world_partner_kooper_ROM_END;
extern Addr world_partner_kooper_VRAM;
extern Addr world_partner_bombette_ROM_START;
extern Addr world_partner_bombette_ROM_END;
extern Addr world_partner_bombette_VRAM;
extern Addr world_partner_parakarry_ROM_START;
extern Addr world_partner_parakarry_ROM_END;
extern Addr world_partner_parakarry_VRAM;
extern Addr world_partner_goompa_ROM_START;
extern Addr world_partner_goompa_ROM_END;
extern Addr world_partner_goompa_VRAM;
extern Addr world_partner_watt_ROM_START;
extern Addr world_partner_watt_ROM_END;
extern Addr world_partner_watt_VRAM;
extern Addr world_partner_sushie_ROM_START;
extern Addr world_partner_sushie_ROM_END;
extern Addr world_partner_sushie_VRAM;
extern Addr world_partner_lakilester_ROM_START;
extern Addr world_partner_lakilester_ROM_END;
extern Addr world_partner_lakilester_VRAM;
extern Addr world_partner_bow_ROM_START;
extern Addr world_partner_bow_ROM_END;
extern Addr world_partner_bow_VRAM;
extern Addr world_partner_goombaria_ROM_START;
extern Addr world_partner_goombaria_ROM_END;
extern Addr world_partner_goombaria_VRAM;
extern Addr world_partner_twink_ROM_START;
extern Addr world_partner_twink_ROM_END;
extern Addr world_partner_twink_VRAM;
#endif

s32 partner_is_idle(Npc* partner);
s32 world_partner_can_player_pause_default(Npc* partner);
void _use_partner_ability(void);
Expand Down Expand Up @@ -654,9 +693,13 @@ void _use_partner_ability(void) {
}

if (PartnerCommand >= PARTNER_CMD_INSTA_SWITCH) {
#if VERSION_JP
D_8010CFC4 = 0;
#else
if (PartnerCommand != PARTNER_CMD_USE_ABILITY) {
D_8010CFC4 = 0;
}
#endif
}

switch (PartnerCommand) {
Expand Down
114 changes: 114 additions & 0 deletions ver/jp/asm/bss2.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
.include "macro.inc"

# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purpose registers

#ifndef SHIFT

.section .bss

dlabel PulseStoneNotificationCallback
.space 4

dlabel D_8010C924
.space 4

dlabel D_8010C928
.space 4

dlabel D_8010C92C
.space 4

dlabel wPartnerNpc
.space 4

dlabel TweesterTouchingPlayer
.space 4

dlabel PlayerNormalYaw
.space 4

dlabel ISpyNotificationCallback
.space 4

dlabel TalkNotificationCallback
.space 4

dlabel gSpinHistoryBufferPos
.space 4

dlabel D_8010C948
.space 4

dlabel NpcHitQueryBehindRightY
.space 4

dlabel D_8010C950
.space 4

dlabel TweesterTouchingPartner
.space 4

dlabel InteractNotificationCallback
.space 4

dlabel PrevPlayerDirection
.space 4

dlabel JumpedOnSwitchX
.space 4

dlabel D_8010C964
.space 4

dlabel NpcHitQueryBehindCollider
.space 4

dlabel PeachDisguiseNpcIndex
.space 4

dlabel NpcHitQueryAheadY
.space 4

dlabel NpcHitQueryBehindLeftY
.space 4

dlabel NpcHitQueryColliderID
.space 4

dlabel JumpedOnSwitchZ
.space 4

dlabel PlayerRunStateTime
.space 4

dlabel D_8010C984
.space 4

dlabel D_8010C988
.space 4

dlabel NpcHitQueryAheadCollider
.space 4

dlabel PlayerNormalPitch
.space 4

dlabel D_8010C994
.space 0x0000000c

dlabel PlayerYInterpUpdateDelay
.space 4

dlabel D_8010C9A4
.space 0x0000000c

dlabel D_8010C9B0
.space 4

dlabel D_8010C9B4
.space 0x0000000c

#endif
Loading

0 comments on commit 84185a1

Please sign in to comment.