Compare commits

...

3 Commits

Author SHA1 Message Date
LittleCube be789d40c9 fix init event to not be terrible 2024-09-25 21:29:03 -04:00
LittleCube 946fbb1fa2 add init event 2024-09-25 21:07:55 -04:00
LittleCube 78c0e24b8b add more flexible owl events 2024-09-25 20:05:23 -04:00
3 changed files with 11 additions and 1 deletions

View File

@ -747,18 +747,23 @@ RECOMP_EXPORT void recomp_set_owls_quit_game(bool new_val)
owls_quit_game = new_val;
}
RECOMP_DECLARE_EVENT(recomp_on_owl_update(ObjWarpstone* this, PlayState* play));
RECOMP_DECLARE_EVENT(recomp_on_owl_save(ObjWarpstone* this, PlayState* play));
RECOMP_DECLARE_EVENT(recomp_after_owl_save(ObjWarpstone* this, PlayState* play));
// @recomp If autosave is enabled, skip the part of the owl statue dialog that talks about the file being deleted on load, since it's not true.
RECOMP_PATCH void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
ObjWarpstone* this = (ObjWarpstone*)thisx;
s32 pad;
recomp_on_owl_update(this, play);
if (this->isTalking) {
if (Actor_TextboxIsClosing(&this->dyna.actor, play)) {
this->isTalking = false;
} else if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
if (play->msgCtx.choiceIndex != 0) {
recomp_on_owl_save(this, play);
Audio_PlaySfx_MessageDecide();
if (!owls_quit_game) {
Message_CloseTextbox(play);
@ -768,7 +773,7 @@ RECOMP_PATCH void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
play->msgCtx.unk120D6 = 0;
play->msgCtx.unk120D4 = 0;
gSaveContext.save.owlWarpId = OBJ_WARPSTONE_GET_OWL_WARP_ID(&this->dyna.actor);
recomp_on_owl_save(this, play);
recomp_after_owl_save(this, play);
} else {
Message_CloseTextbox(play);
}

View File

@ -16,6 +16,7 @@ void controls_play_update(PlayState* play) {
RECOMP_PATCH void Play_Main(GameState* thisx) {
static Input* prevInput = NULL;
PlayState* this = (PlayState*)thisx;
recomp_on_play_main(this);
// @recomp

View File

@ -7,6 +7,8 @@ void Main_InitMemory(void);
void Main_InitScreen(void);
RECOMP_DECLARE_EVENT(recomp_on_init());
// @recomp Patched to load the code segment in the recomp runtime.
RECOMP_PATCH void Main_Init(void) {
DmaRequest dmaReq;
@ -14,6 +16,8 @@ RECOMP_PATCH void Main_Init(void) {
OSMesg msg[1];
size_t prevSize;
recomp_on_init();
osCreateMesgQueue(&mq, msg, ARRAY_COUNT(msg));
prevSize = gDmaMgrDmaBuffSize;