Remove decomp elf dependency and automate patch relocations (#419)

* Changed patch recompilation to use new reference symbol functionality and removed all manual relocations

* Moved symbol tomls to submodule, switched from objcopy to recompiler output binary mechanism for patch recompilation

* Update N64Recomp commit in CI to symbol_reference_file branch

* Remove option in patches toml that doesn't exist

* Update N64Recomp to fix issue with pause screen cursor, fix some issues caused by patches and overlay function-local statics

* Disable unpaired lo16 warnings and update N64Recomp in CI

* Update build instructions to reflect that the decomp elf is no longer needed
This commit is contained in:
Wiseguy
2024-07-05 16:33:34 -04:00
committed by GitHub
parent 5e3aac4b45
commit 79fc56f1fd
27 changed files with 259 additions and 69465 deletions
+15 -31
View File
@@ -181,9 +181,7 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
Message_StartTextbox(play, (play->sceneId == SCENE_AYASHIISHOP) ? 0x2A00 : 0x5E6, NULL);
}
} else {
// @recomp Manual relocation, TODO remove when automated.
Input* player_control_input = play->state.input;
*(Input**)KaleidoManager_GetRamAddr(&sPlayerControlInput) = player_control_input;
sPlayerControlInput = play->state.input;
if (play->view.fovy >= 25.0f) {
s16 prevFocusX = thisx->focus.rot.x;
s16 prevFocusY = thisx->focus.rot.y;
@@ -193,7 +191,7 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
// @recomp Add in the analog camera Y input. Clamp to prevent moving the camera twice as fast if both sticks are held.
// Pitch:
inputY = CLAMP(player_control_input->rel.stick_y + analog_y, -60, 60) * 4;
inputY = CLAMP(sPlayerControlInput->rel.stick_y + analog_y, -60, 60) * 4;
// @recomp Invert the Y axis accordingly (default is inverted, so negate if not inverted).
if (!inverted_y) {
inputY = -inputY;
@@ -205,7 +203,7 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
// @recomp Add in the analog camera X input. Clamp to prevent moving the camera twice as fast if both sticks are held.
// Yaw: shape.rot.y is used as a fixed starting position
inputX = CLAMP(player_control_input->rel.stick_x + analog_x, -60, 60) * -4;
inputX = CLAMP(sPlayerControlInput->rel.stick_x + analog_x, -60, 60) * -4;
// @recomp Invert the X axis accordingly.
if (inverted_x) {
inputX = -inputX;
@@ -229,14 +227,14 @@ void func_8083A98C(Actor* thisx, PlayState* play2) {
if (play->sceneId == SCENE_AYASHIISHOP) {
camMode = CAM_MODE_DEKUHIDE;
} else if (CHECK_BTN_ALL(player_control_input->cur.button, BTN_A)) { // Zoom
} else if (CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_A)) { // Zoom
camMode = CAM_MODE_TARGET;
} else {
camMode = CAM_MODE_NORMAL;
}
// Exit
if (CHECK_BTN_ALL(player_control_input->press.button, BTN_B)) {
if (CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B)) {
Message_CloseTextbox(play);
if (play->sceneId == SCENE_00KEIKOKU) {
@@ -355,18 +353,15 @@ u8* get_button_item_equip_ptr(u32 form, u32 button) {
// Return currently-pressed button, in order of priority D-Pad, B, CLEFT, CDOWN, CRIGHT.
EquipSlot func_8082FDC4(void) {
EquipSlot i;
// @recomp Manually relocate, TODO remove this when the recompiler can relocate automatically.
Input* sPlayerControlInput_reloc = *(Input**)KaleidoManager_GetRamAddr(&sPlayerControlInput);
for (int extra_slot_index = 0; extra_slot_index < ARRAY_COUNT(buttons_to_extra_slot); extra_slot_index++) {
if (CHECK_BTN_ALL(sPlayerControlInput_reloc->press.button, buttons_to_extra_slot[extra_slot_index].button)) {
if (CHECK_BTN_ALL(sPlayerControlInput->press.button, buttons_to_extra_slot[extra_slot_index].button)) {
return (EquipSlot)buttons_to_extra_slot[extra_slot_index].slot;
}
}
for (i = 0; i < ARRAY_COUNT(sPlayerItemButtons); i++) {
if (CHECK_BTN_ALL(sPlayerControlInput_reloc->press.button, sPlayerItemButtons[i])) {
if (CHECK_BTN_ALL(sPlayerControlInput->press.button, sPlayerItemButtons[i])) {
break;
}
}
@@ -454,8 +449,7 @@ void Player_Action_86(Player *this, PlayState *play) {
s32 sp48 = false;
func_808323C0(this, play->playerCsIds[PLAYER_CS_ID_MASK_TRANSFORMATION]);
// @recomp Manual relocation, TODO remove when automated.
*(Input**)KaleidoManager_GetRamAddr(&sPlayerControlInput) = play->state.input;
sPlayerControlInput = play->state.input;
Camera_ChangeMode(GET_ACTIVE_CAM(play),
(this->transformation == PLAYER_FORM_HUMAN) ? CAM_MODE_NORMAL : CAM_MODE_JUMP);
@@ -2569,16 +2563,9 @@ s32 func_80857950(PlayState* play, Player* this) {
}
wasOff = isOff;
// @recomp Manual relocation, TODO remove when automated.
Input* player_control_input = *(Input**)KaleidoManager_GetRamAddr(&sPlayerControlInput);
if (((this->unk_B86[1] == 0) && !CHECK_BTN_ALL(player_control_input->cur.button, BTN_A)) ||
if (((this->unk_B86[1] == 0) && !CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_A)) ||
((this->av1.actionVar1 == 3) && (this->actor.velocity.y < 0.0f))) {
// @recomp Manual relocation, TODO remove when automated.
PlayerActionFunc Player_Action_4_reloc = KaleidoManager_GetRamAddr(Player_Action_4);
Player_SetAction(play, this, Player_Action_4_reloc, 1);
Player_SetAction(play, this, Player_Action_4, 1);
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
PlayerAnimation_Change(play, &this->skelAnime, &gPlayerAnim_pg_maru_change, -2.0f / 3.0f, 7.0f, 0.0f,
ANIMMODE_ONCE, 0.0f);
@@ -2611,9 +2598,6 @@ extern void func_80836A5C(Player* this, PlayState* play);
// @recomp Patch the shielding function to respect the aiming axis inversion setting.
void Player_Action_18(Player* this, PlayState* play) {
//@recomp Manual relocation. TODO remove when automated
D_8085BE84_t* D_8085BE84_reloc = (D_8085BE84_t*)KaleidoManager_GetRamAddr(D_8085BE84);
Input* sPlayerControlInput_reloc = *(Input**)KaleidoManager_GetRamAddr(&sPlayerControlInput);
func_80832F24(this);
if (this->transformation == PLAYER_FORM_GORON) {
@@ -2627,7 +2611,7 @@ void Player_Action_18(Player* this, PlayState* play) {
func_80123C58(this);
}
func_80836A98(this, D_8085BE84_reloc[PLAYER_ANIMGROUP_defense_end][this->modelAnimType], play);
func_80836A98(this, D_8085BE84[PLAYER_ANIMGROUP_defense_end][this->modelAnimType], play);
func_80830B38(this);
} else {
this->stateFlags1 |= PLAYER_STATE1_400000;
@@ -2639,7 +2623,7 @@ void Player_Action_18(Player* this, PlayState* play) {
if (PlayerAnimation_Update(play, &this->skelAnime)) {
if (!Player_IsGoronOrDeku(this)) {
Player_AnimationPlayLoop(play, this, D_8085BE84_reloc[PLAYER_ANIMGROUP_defense_wait][this->modelAnimType]);
Player_AnimationPlayLoop(play, this, D_8085BE84[PLAYER_ANIMGROUP_defense_wait][this->modelAnimType]);
}
this->av2.actionVar2 = 1;
@@ -2656,8 +2640,8 @@ void Player_Action_18(Player* this, PlayState* play) {
}
if (this->av2.actionVar2 != 0) {
f32 yStick = sPlayerControlInput_reloc->rel.stick_y * 180;
f32 xStick = sPlayerControlInput_reloc->rel.stick_x * -120;
f32 yStick = sPlayerControlInput->rel.stick_y * 180;
f32 xStick = sPlayerControlInput->rel.stick_x * -120;
s16 temp_a0 = this->actor.shape.rot.y - Camera_GetInputDirYaw(GET_ACTIVE_CAM(play));
s16 var_a1;
s16 temp_ft5;
@@ -2717,7 +2701,7 @@ void Player_Action_18(Player* this, PlayState* play) {
func_80123C58(this);
}
func_80836A98(this, D_8085BE84_reloc[PLAYER_ANIMGROUP_defense_end][this->modelAnimType], play);
func_80836A98(this, D_8085BE84[PLAYER_ANIMGROUP_defense_end][this->modelAnimType], play);
}
Player_PlaySfx(this, NA_SE_IT_SHIELD_REMOVE);