This commit is contained in:
AltoXorg 2024-06-22 22:06:40 -04:00 committed by GitHub
commit 0d6dd223b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 893 additions and 760 deletions

View File

@ -5,7 +5,7 @@
This guide will help you build the project on your local machine. The process will require you to provide two items: This guide will help you build the project on your local machine. The process will require you to provide two items:
- A decompressed ROM of the US version of the game. - A decompressed ROM of the US version of the game.
- An elf file created from [this commit](https://github.com/zeldaret/mm/tree/23beee0717364de43ca9a82957cc910cf818de90) of the Majora's Mask decompilation. - An elf file created from [this commit](https://github.com/zeldaret/mm/tree/45ae63ccc550ea29f475669a87f7f8ac681a6b29) of the Majora's Mask decompilation.
These steps cover: acquiring these, running the required processes and finally building the project. These steps cover: acquiring these, running the required processes and finally building the project.
@ -41,16 +41,7 @@ choco install make
``` ```
## 3. Creating the ELF file & decompressed ROM ## 3. Creating the ELF file & decompressed ROM
You will need to build [this commit](https://github.com/zeldaret/mm/tree/23beee0717364de43ca9a82957cc910cf818de90) of the Majora's Mask decompilation. Follow their build instructions to generate the ELF file and decompressed ROM. However, while building you may get the following build error: You will need to build [this commit](https://github.com/zeldaret/mm/tree/45ae63ccc550ea29f475669a87f7f8ac681a6b29) of the Majora's Mask decompilation. For convenience you may also use `lib/mm-decomp` subfolder in this repository. Follow their build instructions to generate the ELF file and decompressed ROM.
```bash
RuntimeError: 'jr' instruction does not have an 'jump label' field
```
To fix this you will have to modify the problematic file `tools/disasm/disasm.py` at line 1115. This issue is due to a bug in this specific commit of the decomp project and will be resolved once Zelda64Recomp is updated to a more recent commit. To fix it, replace the line:
```diff
- elif insn.isJump():
+ elif insn.isJumpWithAddress():
```
Upon successful build it will generate the two required files. Copy them to the root of the Zelda64Recomp repository: Upon successful build it will generate the two required files. Copy them to the root of the Zelda64Recomp repository:
- `mm.us.rev1.rom_uncompressed.elf` - `mm.us.rev1.rom_uncompressed.elf`

@ -1 +1 @@
Subproject commit 5607eec18bae68e4cd38ef6d1fa69d7f1d84bfc8 Subproject commit 45ae63ccc550ea29f475669a87f7f8ac681a6b29

View File

@ -1,5 +1,6 @@
#include "patches.h" #include "patches.h"
#include "play_patches.h" #include "play_patches.h"
#include "z64cutscene.h"
#include "z64save.h" #include "z64save.h"
#include "z64horse.h" #include "z64horse.h"
#include "overlays/gamestates/ovl_file_choose/z_file_select.h" #include "overlays/gamestates/ovl_file_choose/z_file_select.h"
@ -443,7 +444,7 @@ void autosave_init() {
} }
extern s32 gFlashSaveSizes[]; extern s32 gFlashSaveSizes[];
extern u16 D_801C6A58[]; extern u16 sOwlWarpEntrances[];
#define CHECK_NEWF(newf) \ #define CHECK_NEWF(newf) \
((newf)[0] != 'Z' || (newf)[1] != 'E' || (newf)[2] != 'L' || (newf)[3] != 'D' || (newf)[4] != 'A' || \ ((newf)[0] != 'Z' || (newf)[1] != 'E' || (newf)[2] != 'L' || (newf)[3] != 'D' || (newf)[4] != 'A' || \
@ -462,7 +463,7 @@ typedef struct {
} CutsceneManager; // size = 0x18 } CutsceneManager; // size = 0x18
extern CutsceneManager sCutsceneMgr; extern CutsceneManager sCutsceneMgr;
extern ActorCutscene* sSceneCutsceneList; extern CutsceneEntry* sSceneCutsceneList;
extern s16 sSceneCutsceneCount; extern s16 sSceneCutsceneCount;
bool skip_entry_cutscene = false; bool skip_entry_cutscene = false;
@ -623,7 +624,7 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
func_80147314(sramCtx, fileNum); func_80147314(sramCtx, fileNum);
} }
else { else {
gSaveContext.save.entrance = D_801C6A58[(void)0, gSaveContext.save.owlWarpId]; gSaveContext.save.entrance = sOwlWarpEntrances[(void)0, gSaveContext.save.owlWarpId];
if ((gSaveContext.save.entrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) && if ((gSaveContext.save.entrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) &&
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) { CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
gSaveContext.save.entrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10); gSaveContext.save.entrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10);
@ -655,7 +656,7 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
autosave_init(); autosave_init();
} }
extern s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState); extern s32 Actor_TalkOfferAccepted(Actor* actor, GameState* gameState);
// @recomp Reset the autosave timer when the moon crashes. // @recomp Reset the autosave timer when the moon crashes.
void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) { void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
@ -728,7 +729,7 @@ void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
} }
} }
} else if (Actor_ProcessTalkRequest(&this->dyna.actor, &play->state)) { } else if (Actor_TalkOfferAccepted(&this->dyna.actor, &play->state)) {
this->isTalking = true; this->isTalking = true;
} else if (!this->actionFunc(this, play)) { } else if (!this->actionFunc(this, play)) {
Actor_OfferTalkNearColChkInfoCylinder(&this->dyna.actor, play); Actor_OfferTalkNearColChkInfoCylinder(&this->dyna.actor, play);

View File

@ -30,6 +30,9 @@
// Matrix_RotateAxisF in NEW // Matrix_RotateAxisF in NEW
// Matrix_RotateAxisS in NEW // Matrix_RotateAxisS in NEW
extern MtxF* sCurrentMatrix;
extern MtxF* sMatrixStack;
#define MATRIX_STACK_SIZE 20 #define MATRIX_STACK_SIZE 20
MtxF* play_billboard_matrix; MtxF* play_billboard_matrix;

View File

@ -1900,7 +1900,7 @@ void skip_analog_cam_once() {
} }
extern void func_809ECD00(Boss04* this, PlayState* play); extern void func_809ECD00(Boss04* this, PlayState* play);
extern s32 func_800B7298(struct PlayState* play, Actor* csActor, u8 csAction); extern s32 Player_SetCsActionWithHaltedActors(struct PlayState* play, Actor* csActor, u8 csAction);
extern u8 D_809EE4D0; extern u8 D_809EE4D0;
// @recomp Patch the Wart boss fight in the Great Bay temple so that the fight starts if you look at it with the right stick analog camera, // @recomp Patch the Wart boss fight in the Great Bay temple so that the fight starts if you look at it with the right stick analog camera,
@ -1947,7 +1947,7 @@ void func_809EC568(Boss04* this, PlayState* play) {
this->subCamId = Play_CreateSubCamera(play); this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT); Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
func_800B7298(play, &this->actor, PLAYER_CSACTION_WAIT); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_WAIT);
player->actor.world.pos.x = this->unk_6E8; player->actor.world.pos.x = this->unk_6E8;
player->actor.world.pos.z = this->unk_6F0 + 410.0f; player->actor.world.pos.z = this->unk_6F0 + 410.0f;
player->actor.shape.rot.y = 0x7FFF; player->actor.shape.rot.y = 0x7FFF;
@ -1997,7 +1997,7 @@ void func_809EC568(Boss04* this, PlayState* play) {
if (this->unk_704 == 45) { if (this->unk_704 == 45) {
this->unk_708 = 1; this->unk_708 = 1;
this->unk_704 = 0; this->unk_704 = 0;
func_800B7298(play, &this->actor, PLAYER_CSACTION_21); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_21);
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
break; break;
} }
@ -2075,9 +2075,9 @@ void func_809EC568(Boss04* this, PlayState* play) {
func_80169AFC(play, this->subCamId, 0); func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE; this->subCamId = SUB_CAM_ID_DONE;
Cutscene_StopManual(play, &play->csCtx); Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSACTION_END); Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_END);
Play_DisableMotionBlur(); Play_DisableMotionBlur();
SET_EVENTINF(EVENTINF_60); SET_EVENTINF(EVENTINF_INTRO_CS_WATCHED_WART);
} }
break; break;
} }

View File

@ -36,7 +36,7 @@ void do_warp(PlayState* play, u16 entrance){
// req.dramAddr = text_buffer; // req.dramAddr = text_buffer;
// req.size = play->msgCtx.font.messageEnd; // req.size = play->msgCtx.font.messageEnd;
// recomp_printf("dma from vrom 0x%08X to vram 0x%08x of 0x%04X bytes\n", req.vromAddr, req.dramAddr, req.size); // recomp_printf("dma from vrom 0x%08X to vram 0x%08x of 0x%04X bytes\n", req.vromAddr, req.dramAddr, req.size);
// DmaMgr_ProcessMsg(&req); // DmaMgr_ProcessRequest(&req);
// if (text_buffer[2] != (char)0xFE) { // if (text_buffer[2] != (char)0xFE) {
// recomp_printf("Invalid text\n"); // recomp_printf("Invalid text\n");

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,143 @@
// Required to include MM decomp headers without having built the repo
#ifndef OBJECT_BOSS_HAKUGIN_H
#define OBJECT_BOSS_HAKUGIN_H 1
typedef enum GohtLimb {
/* 0x00 */ GOHT_LIMB_NONE,
/* 0x01 */ GOHT_LIMB_ROOT,
/* 0x02 */ GOHT_LIMB_PELVIS,
/* 0x03 */ GOHT_LIMB_THORAX_ROOT,
/* 0x04 */ GOHT_LIMB_THORAX_WRAPPER,
/* 0x05 */ GOHT_LIMB_FRONT_RIGHT_LEG_ROOT,
/* 0x06 */ GOHT_LIMB_FRONT_RIGHT_UPPER_LEG,
/* 0x07 */ GOHT_LIMB_FRONT_RIGHT_LOWER_LEG_ROOT,
/* 0x08 */ GOHT_LIMB_FRONT_RIGHT_LOWER_LEG,
/* 0x09 */ GOHT_LIMB_FRONT_RIGHT_HOOF,
/* 0x0A */ GOHT_LIMB_FRONT_LEFT_LEG_ROOT,
/* 0x0B */ GOHT_LIMB_FRONT_LEFT_UPPER_LEG,
/* 0x0C */ GOHT_LIMB_FRONT_LEFT_LOWER_LEG_ROOT,
/* 0x0D */ GOHT_LIMB_FRONT_LEFT_LOWER_LEG,
/* 0x0E */ GOHT_LIMB_FRONT_LEFT_HOOF,
/* 0x0F */ GOHT_LIMB_THORAX,
/* 0x10 */ GOHT_LIMB_HEAD,
/* 0x11 */ GOHT_LIMB_JAW_ROOT,
/* 0x12 */ GOHT_LIMB_JAW,
/* 0x13 */ GOHT_LIMB_BACK_RIGHT_LEG_ROOT,
/* 0x14 */ GOHT_LIMB_BACK_RIGHT_LEG_WRAPPER,
/* 0x15 */ GOHT_LIMB_BACK_RIGHT_THIGH,
/* 0x16 */ GOHT_LIMB_BACK_RIGHT_SHIN,
/* 0x17 */ GOHT_LIMB_BACK_RIGHT_PASTERN_ROOT,
/* 0x18 */ GOHT_LIMB_BACK_RIGHT_PASTERN,
/* 0x19 */ GOHT_LIMB_BACK_RIGHT_HOOF,
/* 0x1A */ GOHT_LIMB_BACK_LEFT_LEG_ROOT,
/* 0x1B */ GOHT_LIMB_BACK_LEFT_LEG_WRAPPER,
/* 0x1C */ GOHT_LIMB_BACK_LEFT_THIGH,
/* 0x1D */ GOHT_LIMB_BACK_LEFT_SHIN,
/* 0x1E */ GOHT_LIMB_BACK_LEFT_PASTERN_ROOT,
/* 0x1F */ GOHT_LIMB_BACK_LEFT_PASTERN,
/* 0x20 */ GOHT_LIMB_BACK_LEFT_HOOF,
/* 0x21 */ GOHT_LIMB_MAX
} GohtLimb;
extern s16 sGohtThawAndBreakWallAnimFrameData[];
extern JointIndex sGohtThawAndBreakWallAnimJointIndices[];
extern AnimationHeader gGohtThawAndBreakWallAnim;
extern s16 sGohtWritheOnSideAnimFrameData[];
extern JointIndex sGohtWritheOnSideAnimJointIndices[];
extern AnimationHeader gGohtWritheOnSideAnim;
extern s16 sGohtTwitchOnSideAnimFrameData[];
extern JointIndex sGohtTwitchOnSideAnimJointIndices[];
extern AnimationHeader gGohtTwitchOnSideAnim;
extern s16 sGohtFallOnSideAnimFrameData[];
extern JointIndex sGohtFallOnSideAnimJointIndices[];
extern AnimationHeader gGohtFallOnSideAnim;
extern s16 sGohtStationaryAnimFrameData[];
extern JointIndex sGohtStationaryAnimJointIndices[];
extern AnimationHeader gGohtStationaryAnim;
extern Vtx object_boss_hakuginVtx_0031B0[];
extern Gfx gGohtPelvisDL[];
extern Gfx gGohtBackLeftHoofDL[];
extern Gfx gGohtBackLeftPasternDL[];
extern Gfx gGohtBackLeftShinDL[];
extern Gfx gGohtBackLeftThighDL[];
extern Gfx gGohtBackRightHoofDL[];
extern Gfx gGohtBackRightPasternDL[];
extern Gfx gGohtBackRightShinDL[];
extern Gfx gGohtBackRightThighDL[];
extern Gfx gGohtHeadDL[];
extern Gfx gGohtJawDL[];
extern Gfx gGohtThoraxDL[];
extern Gfx gGohtFrontLeftHoofDL[];
extern Gfx gGohtFrontLeftLowerLegDL[];
extern Gfx gGohtFrontLeftUpperLegDL[];
extern Gfx gGohtFrontRightHoofDL[];
extern Gfx gGohtFrontRightLowerLegDL[];
extern Gfx gGohtFrontRightUpperLegDL[];
extern u64 gGohtMachineryTex[];
extern u64 gGohtMetalPlateWithCirclePatternTex[];
extern u64 gGohtMetalPlateWithMulticoloredPatternTex[];
extern u64 gGohtEyeTex[];
extern u64 gGohtFaceAndKneePatternTex[];
extern u64 gGohtHornTex[];
extern Vtx object_boss_hakuginVtx_0102D8[];
extern Gfx gGohtRockMaterialDL[];
extern Gfx gGohtRockModelDL[];
extern u64 gGohtRockTex[];
extern Vtx object_boss_hakuginVtx_010F80[];
extern Gfx gGohtStalactiteMaterialDL[];
extern Gfx gGohtStalactiteModelDL[];
extern Vtx object_boss_hakuginVtx_0111C8[];
extern Gfx gGohtLightningMaterialDL[];
extern Gfx gGohtLightningModelDL[];
extern u64 gGohtLightningTex[];
extern u8 gGohtUnusedZeroesBlob[];
extern u64 gGohtLightOrbTex[];
extern Vtx object_boss_hakuginVtx_012E90[];
extern Gfx gGohtLightOrbMaterialDL[];
extern Gfx gGohtLightOrbModelDL[];
extern StandardLimb gGohtRootLimb;
extern StandardLimb gGohtPelvisLimb;
extern StandardLimb gGohtThoraxRootLimb;
extern StandardLimb gGohtThoraxWrapperLimb;
extern StandardLimb gGohtFrontRightLegRootLimb;
extern StandardLimb gGohtFrontRightUpperLegLimb;
extern StandardLimb gGohtFrontRightLowerLegRootLimb;
extern StandardLimb gGohtFrontRightLowerLegLimb;
extern StandardLimb gGohtFrontRightHoofLimb;
extern StandardLimb gGohtFrontLeftLegRootLimb;
extern StandardLimb gGohtFrontLeftUpperLegLimb;
extern StandardLimb gGohtFrontLeftLowerLegRootLimb;
extern StandardLimb gGohtFrontLeftLowerLegLimb;
extern StandardLimb gGohtFrontLeftHoofLimb;
extern StandardLimb gGohtThoraxLimb;
extern StandardLimb gGohtHeadLimb;
extern StandardLimb gGohtJawRootLimb;
extern StandardLimb gGohtJawLimb;
extern StandardLimb gGohtBackRightLegRootLimb;
extern StandardLimb gGohtBackRightLegWrapperLimb;
extern StandardLimb gGohtBackRightThighLimb;
extern StandardLimb gGohtBackRightShinLimb;
extern StandardLimb gGohtBackRightPasternRootLimb;
extern StandardLimb gGohtBackRightPasternLimb;
extern StandardLimb gGohtBackRightHoofLimb;
extern StandardLimb gGohtBackLeftLegRootLimb;
extern StandardLimb gGohtBackLeftLegWrapperLimb;
extern StandardLimb gGohtBackLeftThighLimb;
extern StandardLimb gGohtBackLeftShinLimb;
extern StandardLimb gGohtBackLeftPasternRootLimb;
extern StandardLimb gGohtBackLeftPasternLimb;
extern StandardLimb gGohtBackLeftHoofLimb;
extern void* gGohtSkelLimbs[];
extern FlexSkeletonHeader gGohtSkel;
extern s16 sGohtFallDownAnimFrameData[];
extern JointIndex sGohtFallDownAnimJointIndices[];
extern AnimationHeader gGohtFallDownAnim;
extern s16 sGohtRunAnimFrameData[];
extern JointIndex sGohtRunAnimJointIndices[];
extern AnimationHeader gGohtRunAnim;
extern s16 sGohtGetUpFromSideAnimFrameData[];
extern JointIndex sGohtGetUpFromSideAnimJointIndices[];
extern AnimationHeader gGohtGetUpFromSideAnim;
extern u64 gGohtTitleCardTex[];
#endif

View File

@ -2,6 +2,7 @@
#include "graphics.h" #include "graphics.h"
#include "sys_cfb.h" #include "sys_cfb.h"
#include "z64view.h" #include "z64view.h"
#include "z64circle_tex.h"
#include "transform_ids.h" #include "transform_ids.h"
extern TransitionOverlay gTransitionOverlayTable[]; extern TransitionOverlay gTransitionOverlayTable[];
@ -85,7 +86,7 @@ void Play_DrawMotionBlur(PlayState* this) {
OPEN_DISPS(gfxCtx); OPEN_DISPS(gfxCtx);
gfxHead = POLY_OPA_DISP; gfxHead = POLY_OPA_DISP;
gfx = Graph_GfxPlusOne(gfxHead); gfx = Gfx_Open(gfxHead);
gSPDisplayList(OVERLAY_DISP++, gfx); gSPDisplayList(OVERLAY_DISP++, gfx);
@ -122,7 +123,7 @@ void Play_DrawMotionBlur(PlayState* this) {
gSPEndDisplayList(gfx++); gSPEndDisplayList(gfx++);
Graph_BranchDlist(gfxHead, gfx); Gfx_Close(gfxHead, gfx);
POLY_OPA_DISP = gfx; POLY_OPA_DISP = gfx;
@ -144,7 +145,7 @@ void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) {
// @recomp Patched to use ortho tris for interpolation and to prevent the telescope and lens effects from getting stretched wide. // @recomp Patched to use ortho tris for interpolation and to prevent the telescope and lens effects from getting stretched wide.
void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, TexturePtr texture, s32 fmt, s32 arg3, s32 masks, s32 maskt, void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, void const* texture, s32 fmt, s32 arg3, s32 masks, s32 maskt,
f32 arg6) { f32 arg6) {
Gfx* gfx = *gfxp; Gfx* gfx = *gfxp;
s32 xh = gCfbWidth; s32 xh = gCfbWidth;

View File

@ -95,7 +95,7 @@ s16 KaleidoScope_SetPageVertices(PlayState* play, Vtx* vtx, s16 vtxPage, s16 num
vtx[k + 1].v.ob[0] = vtx[k + 3].v.ob[0] = vtx[k + 0].v.ob[0] + quadsWidth[i]; vtx[k + 1].v.ob[0] = vtx[k + 3].v.ob[0] = vtx[k + 0].v.ob[0] + quadsWidth[i];
if (!IS_PAUSE_STATE_GAMEOVER) { if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) {
vtx[k + 0].v.ob[1] = vtx[k + 1].v.ob[1] = quadsY[i] + pauseCtx->offsetY; vtx[k + 0].v.ob[1] = vtx[k + 1].v.ob[1] = quadsY[i] + pauseCtx->offsetY;
} else if (gameOverCtx->state == GAMEOVER_INACTIVE) { } else if (gameOverCtx->state == GAMEOVER_INACTIVE) {
vtx[k + 0].v.ob[1] = vtx[k + 1].v.ob[1] = quadsY[i] + pauseCtx->offsetY; vtx[k + 0].v.ob[1] = vtx[k + 1].v.ob[1] = quadsY[i] + pauseCtx->offsetY;

View File

@ -1,8 +1,6 @@
#include "patches.h" #include "patches.h"
#include "input.h" #include "input.h"
#include "z64snap.h" #include "z64snap.h"
// Decomp rename, TODO update decomp and remove this
#define AudioVoice_GetWord func_801A5100
#include "z64voice.h" #include "z64voice.h"
#include "audiothread_cmd.h" #include "audiothread_cmd.h"
@ -543,7 +541,7 @@ void Player_Action_86(Player *this, PlayState *play) {
extern s16 sPictoState; extern s16 sPictoState;
extern s16 sPictoPhotoBeingTaken; extern s16 sPictoPhotoBeingTaken;
extern void* gWorkBuffer; extern void* gWorkBuffer;
u16 func_801A5100(void); u16 AudioVoice_GetWord(void);
// @recomp Patched to update status of extra buttons via set_extra_item_slot_status. // @recomp Patched to update status of extra buttons via set_extra_item_slot_status.
void Interface_UpdateButtonsPart1(PlayState* play) { void Interface_UpdateButtonsPart1(PlayState* play) {
@ -2600,7 +2598,7 @@ extern s32 Player_ActionChange_11(Player* this, PlayState* play);
extern void func_8083A98C(Actor* thisx, PlayState* play2); extern void func_8083A98C(Actor* thisx, PlayState* play2);
extern void func_80836A98(Player* this, PlayerAnimationHeader* anim, PlayState* play); extern void func_80836A98(Player* this, PlayerAnimationHeader* anim, PlayState* play);
extern void func_80830B38(Player* this); extern void func_80830B38(Player* this);
extern void Player_AnimationPlayLoop(PlayState* play, Player* this, PlayerAnimationHeader* anim); extern void Player_Anim_PlayLoop(PlayState* play, Player* this, PlayerAnimationHeader* anim);
extern s32 Player_UpdateUpperBody(Player* this, PlayState* play); extern s32 Player_UpdateUpperBody(Player* this, PlayState* play);
extern void func_8082F164(Player* this, u16 button); extern void func_8082F164(Player* this, u16 button);
extern s32 func_808401F4(PlayState* play, Player* this); extern s32 func_808401F4(PlayState* play, Player* this);
@ -2639,7 +2637,7 @@ void Player_Action_18(Player* this, PlayState* play) {
if (PlayerAnimation_Update(play, &this->skelAnime)) { if (PlayerAnimation_Update(play, &this->skelAnime)) {
if (!Player_IsGoronOrDeku(this)) { if (!Player_IsGoronOrDeku(this)) {
Player_AnimationPlayLoop(play, this, D_8085BE84_reloc[PLAYER_ANIMGROUP_defense_wait][this->modelAnimType]); Player_Anim_PlayLoop(play, this, D_8085BE84_reloc[PLAYER_ANIMGROUP_defense_wait][this->modelAnimType]);
} }
this->av2.actionVar2 = 1; this->av2.actionVar2 = 1;

View File

@ -5,10 +5,9 @@
#include "audiomgr.h" #include "audiomgr.h"
#include "z64speed_meter.h" #include "z64speed_meter.h"
#include "z64vimode.h" #include "z64vimode.h"
#include "z64viscvg.h" #include "z64vis.h"
#include "z64vismono.h"
#include "z64viszbuf.h"
#include "input.h" #include "input.h"
#include "scheduler.h"
void recomp_set_current_frame_poll_id(); void recomp_set_current_frame_poll_id();
void PadMgr_HandleRetrace(void); void PadMgr_HandleRetrace(void);
@ -169,7 +168,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
// osSyncPrintf("GRAPH SP TIMEOUT\n"); // osSyncPrintf("GRAPH SP TIMEOUT\n");
// if (retryCount >= 0) { // if (retryCount >= 0) {
// retryCount--; // retryCount--;
// Sched_SendGfxCancelMsg(&gSchedContext); // Sched_SendGfxCancelMsg(&gScheduler);
// goto retry; // goto retry;
// } else { // } else {
// // graph.c: No more! die! // // graph.c: No more! die!
@ -185,20 +184,20 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
task->type = M_GFXTASK; task->type = M_GFXTASK;
task->flags = OS_SC_DRAM_DLIST; task->flags = OS_SC_DRAM_DLIST;
task->ucodeBoot = SysUcode_GetUCodeBoot(); task->ucode_boot = SysUcode_GetUCodeBoot();
task->ucodeBootSize = SysUcode_GetUCodeBootSize(); task->ucode_boot_size = SysUcode_GetUCodeBootSize();
task->ucode = SysUcode_GetUCode(); task->ucode = SysUcode_GetUCode();
task->ucodeData = SysUcode_GetUCodeData(); task->ucode_data = SysUcode_GetUCodeData();
task->ucodeSize = SP_UCODE_SIZE; task->ucode_size = SP_UCODE_SIZE;
task->ucodeDataSize = SP_UCODE_DATA_SIZE; task->ucode_data_size = SP_UCODE_DATA_SIZE;
task->dramStack = (u64*)gGfxSPTaskStack; task->dram_stack = (u64*)gGfxSPTaskStack;
task->dramStackSize = sizeof(gGfxSPTaskStack); task->dram_stack_size = sizeof(gGfxSPTaskStack);
task->outputBuff = gGfxSPTaskOutputBufferPtr; task->output_buff = gGfxSPTaskOutputBufferPtr;
task->outputBuffSize = gGfxSPTaskOutputBufferEnd; task->output_buff_size = gGfxSPTaskOutputBufferEnd;
task->dataPtr = (u64*)gGfxMasterDL; task->data_ptr = (u64*)gGfxMasterDL;
task->dataSize = 0; task->data_size = 0;
task->yieldDataPtr = (u64*)gGfxSPTaskYieldBuffer; task->yield_data_ptr = (u64*)gGfxSPTaskYieldBuffer;
task->yieldDataSize = sizeof(gGfxSPTaskYieldBuffer); task->yield_data_size = sizeof(gGfxSPTaskYieldBuffer);
scTask->next = NULL; scTask->next = NULL;
scTask->flags = OS_SC_RCP_MASK | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK; scTask->flags = OS_SC_RCP_MASK | OS_SC_SWAPBUFFER | OS_SC_LAST_TASK;
@ -217,13 +216,13 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
cfb = &sGraphCfbInfos[cfbIdx]; cfb = &sGraphCfbInfos[cfbIdx];
cfbIdx = (cfbIdx + 1) % ARRAY_COUNT(sGraphCfbInfos); cfbIdx = (cfbIdx + 1) % ARRAY_COUNT(sGraphCfbInfos);
cfb->fb1 = gfxCtx->curFrameBuffer; cfb->framebuffer = gfxCtx->curFrameBuffer;
cfb->swapBuffer = gfxCtx->curFrameBuffer; cfb->swapBuffer = gfxCtx->curFrameBuffer;
if (gfxCtx->updateViMode) { if (gfxCtx->updateViMode) {
gfxCtx->updateViMode = false; gfxCtx->updateViMode = false;
cfb->viMode = gfxCtx->viMode; cfb->viMode = gfxCtx->viMode;
cfb->features = gfxCtx->viConfigFeatures; cfb->viFeatures = gfxCtx->viConfigFeatures;
cfb->xScale = gfxCtx->xScale; cfb->xScale = gfxCtx->xScale;
cfb->yScale = gfxCtx->yScale; cfb->yScale = gfxCtx->yScale;
} else { } else {
@ -238,9 +237,9 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
osRecvMesg(&gfxCtx->queue, NULL, OS_MESG_NOBLOCK); osRecvMesg(&gfxCtx->queue, NULL, OS_MESG_NOBLOCK);
} }
gfxCtx->schedMsgQ = &gSchedContext.cmdQ; gfxCtx->schedMsgQ = &gScheduler.cmdQueue;
osSendMesg(&gSchedContext.cmdQ, scTask, OS_MESG_BLOCK); osSendMesg(&gScheduler.cmdQueue, scTask, OS_MESG_BLOCK);
Sched_SendEntryMsg(&gSchedContext); Sched_SendNotifyMsg(&gScheduler);
// @recomp Immediately wait on the task to complete to minimize latency for the next one. // @recomp Immediately wait on the task to complete to minimize latency for the next one.
osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_BLOCK); osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_BLOCK);
@ -248,7 +247,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
// @recomp Wait on the VI framebuffer to change if this task has a framebuffer swap. // @recomp Wait on the VI framebuffer to change if this task has a framebuffer swap.
if (scTask->flags & OS_SC_SWAPBUFFER) { if (scTask->flags & OS_SC_SWAPBUFFER) {
int viCounter = 0; int viCounter = 0;
while (osViGetCurrentFramebuffer() != cfb->fb1) { while (osViGetCurrentFramebuffer() != cfb->framebuffer) {
osRecvMesg(&vi_queue, NULL, OS_MESG_BLOCK); osRecvMesg(&vi_queue, NULL, OS_MESG_BLOCK);
viCounter++; viCounter++;
} }
@ -267,7 +266,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx, GameState* gameState) {
extern SpeedMeter sGameSpeedMeter; extern SpeedMeter sGameSpeedMeter;
extern VisCvg sGameVisCvg; extern VisCvg sGameVisCvg;
extern VisZbuf sGameVisZbuf; extern VisZBuf sGameVisZBuf;
extern VisMono sGameVisMono; extern VisMono sGameVisMono;
extern ViMode sGameViMode; extern ViMode sGameViMode;
@ -285,7 +284,7 @@ void GameState_Destroy(GameState* gameState) {
Rumble_Destroy(); Rumble_Destroy();
SpeedMeter_Destroy(&sGameSpeedMeter); SpeedMeter_Destroy(&sGameSpeedMeter);
VisCvg_Destroy(&sGameVisCvg); VisCvg_Destroy(&sGameVisCvg);
VisZbuf_Destroy(&sGameVisZbuf); VisZBuf_Destroy(&sGameVisZBuf);
VisMono_Destroy(&sGameVisMono); VisMono_Destroy(&sGameVisMono);
ViMode_Destroy(&sGameViMode); ViMode_Destroy(&sGameViMode);
THA_Destroy(&gameState->tha); THA_Destroy(&gameState->tha);

View File

@ -128,15 +128,15 @@ void FileSelect_Init(GameState* thisx) {
size = SEGMENT_ROM_SIZE(title_static); size = SEGMENT_ROM_SIZE(title_static);
this->staticSegment = THA_AllocTailAlign16(&this->state.tha, size); this->staticSegment = THA_AllocTailAlign16(&this->state.tha, size);
DmaMgr_SendRequest0(this->staticSegment, SEGMENT_ROM_START(title_static), size); DmaMgr_RequestSync(this->staticSegment, SEGMENT_ROM_START(title_static), size);
size = SEGMENT_ROM_SIZE(parameter_static); size = SEGMENT_ROM_SIZE(parameter_static);
this->parameterSegment = THA_AllocTailAlign16(&this->state.tha, size); this->parameterSegment = THA_AllocTailAlign16(&this->state.tha, size);
DmaMgr_SendRequest0(this->parameterSegment, SEGMENT_ROM_START(parameter_static), size); DmaMgr_RequestSync(this->parameterSegment, SEGMENT_ROM_START(parameter_static), size);
size = gObjectTable[OBJECT_MAG].vromEnd - gObjectTable[OBJECT_MAG].vromStart; size = gObjectTable[OBJECT_MAG].vromEnd - gObjectTable[OBJECT_MAG].vromStart;
this->titleSegment = THA_AllocTailAlign16(&this->state.tha, size); this->titleSegment = THA_AllocTailAlign16(&this->state.tha, size);
DmaMgr_SendRequest0(this->titleSegment, gObjectTable[OBJECT_MAG].vromStart, size); DmaMgr_RequestSync(this->titleSegment, gObjectTable[OBJECT_MAG].vromStart, size);
Audio_SetSpec(0xA); Audio_SetSpec(0xA);
// Setting ioData to 1 and writing it to ioPort 7 will skip the harp intro // Setting ioData to 1 and writing it to ioPort 7 will skip the harp intro

View File

@ -20,7 +20,6 @@
#define sinf __sinf_recomp #define sinf __sinf_recomp
#define cosf __cosf_recomp #define cosf __cosf_recomp
#define bzero bzero_recomp #define bzero bzero_recomp
#define gRandFloat sRandFloat
#include "global.h" #include "global.h"
#include "rt64_extended_gbi.h" #include "rt64_extended_gbi.h"

View File

@ -140,8 +140,8 @@ void Sched_ThreadEntry(void* arg) {
Sched_HandleGfxCancel(sched); Sched_HandleGfxCancel(sched);
continue; continue;
case ENTRY_MSG: case NOTIFY_MSG:
Sched_HandleEntry(sched); Sched_HandleNotify(sched);
continue; continue;
case RSP_DONE_MSG: case RSP_DONE_MSG:
@ -164,11 +164,11 @@ void Sched_ThreadEntry(void* arg) {
continue; continue;
case OS_SC_PRE_NMI_MSG: case OS_SC_PRE_NMI_MSG:
Sched_HandleReset(sched); Sched_HandlePreNMI(sched);
continue; continue;
case OS_SC_NMI_MSG: case OS_SC_NMI_MSG:
Sched_HandleStop(sched); Sched_HandleNMI(sched);
continue; continue;
} }
} }
@ -201,14 +201,14 @@ void DmaMgr_ThreadEntry(void* a0) {
req = (DmaRequest*)msg; req = (DmaRequest*)msg;
DmaMgr_ProcessMsg(req); DmaMgr_ProcessRequest(req);
if (req->notifyQueue) { if (req->notifyQueue) {
osSendMesg(req->notifyQueue, req->notifyMsg, OS_MESG_NOBLOCK); osSendMesg(req->notifyQueue, req->notifyMsg, OS_MESG_NOBLOCK);
} }
} }
} }
extern SchedContext gSchedContext; extern Scheduler gScheduler;
void handle_quicksave_actions_main() { void handle_quicksave_actions_main() {
recomp_handle_quicksave_actions_main(&quicksave_enter_mq, &quicksave_exit_mq); recomp_handle_quicksave_actions_main(&quicksave_enter_mq, &quicksave_exit_mq);
@ -226,7 +226,7 @@ void wake_threads_for_quicksave_action() {
// Wake up the DmaMgr thread // Wake up the DmaMgr thread
osSendMesg(&sDmaMgrMsgQueue, (OSMesg)RECOMP_DMAMGR_QUICKSAVE_MESSAGE, OS_MESG_BLOCK); osSendMesg(&sDmaMgrMsgQueue, (OSMesg)RECOMP_DMAMGR_QUICKSAVE_MESSAGE, OS_MESG_BLOCK);
// Wake up the Sched thread // Wake up the Sched thread
osSendMesg(&gSchedContext.interruptQ, (OSMesg)RECOMP_QUICKSAVE_ACTION, OS_MESG_BLOCK); osSendMesg(&gScheduler.interruptQ, (OSMesg)RECOMP_QUICKSAVE_ACTION, OS_MESG_BLOCK);
} }
#endif #endif

View File

@ -22,7 +22,7 @@ void Main_Init(void) {
// @recomp Load the code segment in the recomp runtime. // @recomp Load the code segment in the recomp runtime.
recomp_load_overlays(SEGMENT_ROM_START(code), SEGMENT_START(code), SEGMENT_ROM_END(code) - SEGMENT_ROM_START(code)); recomp_load_overlays(SEGMENT_ROM_START(code), SEGMENT_START(code), SEGMENT_ROM_END(code) - SEGMENT_ROM_START(code));
DmaMgr_SendRequestImpl(&dmaReq, SEGMENT_START(code), SEGMENT_ROM_START(code), DmaMgr_RequestAsync(&dmaReq, SEGMENT_START(code), SEGMENT_ROM_START(code),
SEGMENT_ROM_END(code) - SEGMENT_ROM_START(code), 0, &mq, NULL); SEGMENT_ROM_END(code) - SEGMENT_ROM_START(code), 0, &mq, NULL);
Main_InitScreen(); Main_InitScreen();
Main_InitMemory(); Main_InitMemory();
@ -50,7 +50,7 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* ramStart, void
if (gOverlayLogSeverity >= 3) {} if (gOverlayLogSeverity >= 3) {}
end = (uintptr_t)allocatedRamAddr + size; end = (uintptr_t)allocatedRamAddr + size;
DmaMgr_SendRequest0(allocatedRamAddr, vromStart, size); DmaMgr_RequestSync(allocatedRamAddr, vromStart, size);
ovlRelocs = (OverlayRelocationSection*)(end - ((s32*)end)[-1]); ovlRelocs = (OverlayRelocationSection*)(end - ((s32*)end)[-1]);

View File

@ -5,7 +5,7 @@
extern OSMesgQueue sFlashromMesgQueue; extern OSMesgQueue sFlashromMesgQueue;
s32 SysFlashrom_IsInit(void); s32 SysFlashrom_IsInit(void);
void Sleep_Msec(u32 ms); void msleep(u32 ms);
// @recomp Patched to not wait a hardcoded amount of time for the save to complete. // @recomp Patched to not wait a hardcoded amount of time for the save to complete.
void Sram_UpdateWriteToFlashDefault(SramContext* sramCtx) { void Sram_UpdateWriteToFlashDefault(SramContext* sramCtx) {

View File

@ -10,7 +10,7 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId
Gfx_SetupDL40_Opa(gfxCtx); Gfx_SetupDL40_Opa(gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x0B, skyboxCtx->paletteStaticSegment); gSPSegment(POLY_OPA_DISP++, 0x0B, skyboxCtx->palette);
gSPTexture(POLY_OPA_DISP++, 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON); gSPTexture(POLY_OPA_DISP++, 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON);
sSkyboxDrawMatrix = GRAPH_ALLOC(gfxCtx, sizeof(Mtx)); sSkyboxDrawMatrix = GRAPH_ALLOC(gfxCtx, sizeof(Mtx));
@ -40,7 +40,7 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId
gDPSetColorDither(POLY_OPA_DISP++, G_CD_MAGICSQ); gDPSetColorDither(POLY_OPA_DISP++, G_CD_MAGICSQ);
gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_BILERP); gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_BILERP);
gDPLoadTLUT_pal256(POLY_OPA_DISP++, skyboxCtx->paletteStaticSegment); gDPLoadTLUT_pal256(POLY_OPA_DISP++, skyboxCtx->palette);
gDPSetTextureLUT(POLY_OPA_DISP++, G_TT_RGBA16); gDPSetTextureLUT(POLY_OPA_DISP++, G_TT_RGBA16);
gDPSetTextureConvert(POLY_OPA_DISP++, G_TC_FILT); gDPSetTextureConvert(POLY_OPA_DISP++, G_TC_FILT);
gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0, gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, TEXEL0, PRIMITIVE_ALPHA, TEXEL0, TEXEL1, TEXEL0, PRIMITIVE, TEXEL0,
@ -66,6 +66,8 @@ void Skybox_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId
CLOSE_DISPS(gfxCtx); CLOSE_DISPS(gfxCtx);
} }
void MtxConv_F2L(Mtx* mtx, MtxF* mf);
// @recomp Draw stars with billboarding to allow for interpolation instead of rects. // @recomp Draw stars with billboarding to allow for interpolation instead of rects.
void Environment_DrawSkyboxStarBillboard(GraphicsContext* gfxCtx, MtxF* billboard_mtx, Gfx** gfxp, f32 x, f32 y, f32 z, s32 width, s32 height) { void Environment_DrawSkyboxStarBillboard(GraphicsContext* gfxCtx, MtxF* billboard_mtx, Gfx** gfxp, f32 x, f32 y, f32 z, s32 width, s32 height) {
static Vtx star_verts[] = { static Vtx star_verts[] = {

View File

@ -3,11 +3,6 @@
#include "overlays/actors/ovl_En_Test6/z_en_test6.h" #include "overlays/actors/ovl_En_Test6/z_en_test6.h"
#include "overlays/actors/ovl_En_Test7/z_en_test7.h" #include "overlays/actors/ovl_En_Test7/z_en_test7.h"
// Decomp renames, TODO update decomp and remove these
#define gSoaringWarpCsWindCapsuleTexAnim gameplay_keep_Matanimheader_0815D0
#define gSoaringWarpCsWindCapsuleDL gameplay_keep_DL_080FC8
#define EnTest7_DrawFeathers func_80AF14FC
void EnTest7_DrawFeathers(PlayState* play2, OwlWarpFeather* feathers); void EnTest7_DrawFeathers(PlayState* play2, OwlWarpFeather* feathers);
s32 func_80AF31D0(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx, s32 func_80AF31D0(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx,
Vec3f* scale, Vec3s* rot, Vec3f* pos); Vec3f* scale, Vec3s* rot, Vec3f* pos);

View File

@ -12,10 +12,6 @@
#include "overlays/actors/ovl_En_Twig/z_en_twig.h" #include "overlays/actors/ovl_En_Twig/z_en_twig.h"
#include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h" #include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h"
// Decomp renames, TODO update decomp and remove these
#define EnHonotrap_FlameGroup func_8092F878
#define EnHonotrap_DrawFlameGroup func_80930190
extern EnTanron2* D_80BB8458[82]; extern EnTanron2* D_80BB8458[82];
extern Boss04* D_80BB8450; extern Boss04* D_80BB8450;
extern f32 D_80BB8454; extern f32 D_80BB8454;
@ -650,21 +646,21 @@ extern Gfx gGohtStalactiteMaterialDL[];
extern Gfx gGohtStalactiteModelDL[]; extern Gfx gGohtStalactiteModelDL[];
// @recomp Tag Goht's rocks. // @recomp Tag Goht's rocks.
void func_80B0C398(BossHakugin* this, PlayState* play) { void BossHakugin_DrawRockEffects(BossHakugin* this, PlayState* play) {
BossHakuginEffect* effect; GohtRockEffect* effect;
s32 i; s32 i;
OPEN_DISPS(play->state.gfxCtx); OPEN_DISPS(play->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, gGohtRockMaterialDL); gSPDisplayList(POLY_OPA_DISP++, gGohtRockMaterialDL);
for (i = 0; i < ARRAY_COUNT(this->unk_9F8); i++) { for (i = 0; i < ARRAY_COUNT(this->rockEffects); i++) {
effect = &this->unk_9F8[i]; effect = &this->rockEffects[i];
if ((effect->unk_18 >= 0) && (effect->unk_1A == 0)) { if ((effect->timer >= 0) && (effect->type == GOHT_ROCK_EFFECT_TYPE_BOULDER)) {
Matrix_SetTranslateRotateYXZ(effect->unk_0.x, effect->unk_0.y, effect->unk_0.z, &effect->unk_1C); Matrix_SetTranslateRotateYXZ(effect->pos.x, effect->pos.y, effect->pos.z, &effect->rot);
Matrix_Scale(effect->unk_24, effect->unk_24, effect->unk_24, MTXMODE_APPLY); Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
// @recomp Tag the transform. // @recomp Tag the transform.
gEXMatrixGroupDecomposedVerts(POLY_OPA_DISP++, GOHT_ROCKS_TRANSFORM_ID_START + i + 0 * ARRAY_COUNT(this->unk_9F8), G_EX_PUSH, G_MTX_MODELVIEW, G_EX_EDIT_NONE); gEXMatrixGroupDecomposedVerts(POLY_OPA_DISP++, GOHT_ROCKS_TRANSFORM_ID_START + i + 0 * ARRAY_COUNT(this->rockEffects), G_EX_PUSH, G_MTX_MODELVIEW, G_EX_EDIT_NONE);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gGohtRockModelDL); gSPDisplayList(POLY_OPA_DISP++, gGohtRockModelDL);
@ -675,14 +671,14 @@ void func_80B0C398(BossHakugin* this, PlayState* play) {
} }
gSPDisplayList(POLY_OPA_DISP++, gGohtStalactiteMaterialDL); gSPDisplayList(POLY_OPA_DISP++, gGohtStalactiteMaterialDL);
for (i = 0; i < ARRAY_COUNT(this->unk_9F8); i++) { for (i = 0; i < ARRAY_COUNT(this->rockEffects); i++) {
effect = &this->unk_9F8[i]; effect = &this->rockEffects[i];
if ((effect->unk_18 >= 0) && (effect->unk_1A == 1)) { if ((effect->timer >= 0) && (effect->type == GOHT_ROCK_EFFECT_TYPE_STALACTITE)) {
Matrix_SetTranslateRotateYXZ(effect->unk_0.x, effect->unk_0.y, effect->unk_0.z, &effect->unk_1C); Matrix_SetTranslateRotateYXZ(effect->pos.x, effect->pos.y, effect->pos.z, &effect->rot);
Matrix_Scale(effect->unk_24, effect->unk_24, effect->unk_24, MTXMODE_APPLY); Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
// @recomp Tag the transform. // @recomp Tag the transform.
gEXMatrixGroupDecomposedVerts(POLY_OPA_DISP++, GOHT_ROCKS_TRANSFORM_ID_START + i + 1 * ARRAY_COUNT(this->unk_9F8), G_EX_PUSH, G_MTX_MODELVIEW, G_EX_EDIT_NONE); gEXMatrixGroupDecomposedVerts(POLY_OPA_DISP++, GOHT_ROCKS_TRANSFORM_ID_START + i + 1 * ARRAY_COUNT(this->rockEffects), G_EX_PUSH, G_MTX_MODELVIEW, G_EX_EDIT_NONE);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gGohtStalactiteModelDL); gSPDisplayList(POLY_OPA_DISP++, gGohtStalactiteModelDL);
@ -727,7 +723,7 @@ typedef enum {
/* 25 */ OSN_ANIM_MAX /* 25 */ OSN_ANIM_MAX
} OsnAnimation; } OsnAnimation;
void EnOsn_HandleCsAction(EnOsn* this, PlayState* play); void EnOsn_HandleCutscene(EnOsn* this, PlayState* play);
void EnOsn_Idle(EnOsn* this, PlayState* play); void EnOsn_Idle(EnOsn* this, PlayState* play);
// @recomp Patched to skip interpolation when the Happy Mask Salesman changes animations. // @recomp Patched to skip interpolation when the Happy Mask Salesman changes animations.
@ -742,7 +738,7 @@ void EnOsn_ChooseAction(EnOsn* this, PlayState* play) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, OSN_ANIM_IDLE); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, OSN_ANIM_IDLE);
if (!isSwitchFlagSet) { if (!isSwitchFlagSet) {
// @recomp No need to relocate as this function is replaced, so the patch compilation will pick the new address. // @recomp No need to relocate as this function is replaced, so the patch compilation will pick the new address.
this->actionFunc = EnOsn_HandleCsAction; this->actionFunc = EnOsn_HandleCutscene;
} else { } else {
// @recomp Manual relocation, TODO remove when automated by the recompiler. // @recomp Manual relocation, TODO remove when automated by the recompiler.
this->actionFunc = (EnOsnActionFunc)actor_relocate(&this->actor, EnOsn_Idle); this->actionFunc = (EnOsnActionFunc)actor_relocate(&this->actor, EnOsn_Idle);
@ -757,7 +753,7 @@ void EnOsn_LookFromMask(EnOsn* this);
void EnOsn_FadeOut(EnOsn* this); void EnOsn_FadeOut(EnOsn* this);
// @recomp Patched to skip interpolation when the Happy Mask Salesman changes animations. // @recomp Patched to skip interpolation when the Happy Mask Salesman changes animations.
void EnOsn_HandleCsAction(EnOsn* this, PlayState* play) { void EnOsn_HandleCutscene(EnOsn* this, PlayState* play) {
u8 pad; u8 pad;
s32 cueChannel; s32 cueChannel;

View File

@ -15,6 +15,7 @@ sHappyMaskSalesmanAnimationInfo = 0x80AD22C0;
D_808890F0 = 0x808890F0; D_808890F0 = 0x808890F0;
D_8088911C = 0x8088911C; D_8088911C = 0x8088911C;
D_809EE4D0 = 0x809EE4D0; D_809EE4D0 = 0x809EE4D0;
sOwlWarpEntrances = 0x801C6A58;
/* Dummy addresses that get recompiled into function calls */ /* Dummy addresses that get recompiled into function calls */
recomp_puts = 0x8F000000; recomp_puts = 0x8F000000;

View File

@ -83,7 +83,7 @@ void KaleidoScope_Draw(PlayState* play) {
KaleidoScope_SetView(pauseCtx, pauseCtx->eye.x, pauseCtx->eye.y, pauseCtx->eye.z); KaleidoScope_SetView(pauseCtx, pauseCtx->eye.x, pauseCtx->eye.y, pauseCtx->eye.z);
Gfx_SetupDL42_Opa(play->state.gfxCtx); Gfx_SetupDL42_Opa(play->state.gfxCtx);
if (!IS_PAUSE_STATE_OWL_WARP) { if (!IS_PAUSE_STATE_OWL_WARP(pauseCtx)) {
// Draw Default or Game Over Menus // Draw Default or Game Over Menus
// @recomp Record the current pageIndex, then change it to a dummy value for the KaleidoScope_SetVertices. // @recomp Record the current pageIndex, then change it to a dummy value for the KaleidoScope_SetVertices.
u16 saved_page_index = pauseCtx->pageIndex; u16 saved_page_index = pauseCtx->pageIndex;
@ -99,7 +99,7 @@ void KaleidoScope_Draw(PlayState* play) {
KaleidoScope_SetView(pauseCtx, 0.0f, 0.0f, 64.0f); KaleidoScope_SetView(pauseCtx, 0.0f, 0.0f, 64.0f);
if (!IS_PAUSE_STATE_GAMEOVER) { if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) {
KaleidoScope_DrawInfoPanel(play); KaleidoScope_DrawInfoPanel(play);
} }
@ -622,7 +622,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
OPEN_DISPS(gfxCtx); OPEN_DISPS(gfxCtx);
if (!IS_PAUSE_STATE_GAMEOVER) { if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) {
if (pauseCtx->state != PAUSE_STATE_SAVEPROMPT) { if (pauseCtx->state != PAUSE_STATE_SAVEPROMPT) {
stepR = stepR =

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,9 @@ stubs = [
ignored = [ ignored = [
# Not actually a function # Not actually a function
"D_80186028" "sNonKanjiIndices",
# Was originally named _MakeMotorData
"__osMakeMotorData"
] ]
# Single-instruction patches # Single-instruction patches