diff options
Diffstat (limited to 'engine/overworld')
-rw-r--r-- | engine/overworld/decorations.asm | 55 | ||||
-rw-r--r-- | engine/overworld/time.asm | 10 |
2 files changed, 33 insertions, 32 deletions
diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm index 6cc86181a..447ab236f 100644 --- a/engine/overworld/decorations.asm +++ b/engine/overworld/decorations.asm @@ -10,17 +10,17 @@ _PlayerDecorationMenu: push af ld hl, .MenuHeader call LoadMenuHeader - xor a - ld [wBuffer5], a - ld a, $1 - ld [wBuffer6], a + xor a ; FALSE + ld [wChangedDecorations], a + ld a, $1 ; bed + ld [wCurDecorationCategory], a .top_loop - ld a, [wBuffer6] + ld a, [wCurDecorationCategory] ld [wMenuCursorBuffer], a call .FindCategoriesWithOwnedDecos call DoNthMenu ld a, [wMenuCursorY] - ld [wBuffer6], a + ld [wCurDecorationCategory], a jr c, .exit_menu ld a, [wMenuSelection] ld hl, .pointers @@ -31,7 +31,7 @@ _PlayerDecorationMenu: call ExitMenu pop af ld [wWhichIndexSet], a - ld a, [wBuffer5] + ld a, [wChangedDecorations] ld c, a ret @@ -71,7 +71,7 @@ _PlayerDecorationMenu: xor a ld [wWhichIndexSet], a call .ClearStringBuffer2 - call .FindOwndDecos + call .FindOwnedDecos ld a, 7 call .AppendToStringBuffer2 ld hl, wStringBuffer2 @@ -98,7 +98,7 @@ _PlayerDecorationMenu: ld [hl], a ret -.FindOwndDecos: +.FindOwnedDecos: ld hl, .dw .loop ld a, [hli] @@ -642,12 +642,12 @@ DecoAction_putawaybigdoll: DecoAction_TrySetItUp: ld a, [hl] - ld [wBuffer1], a + ld [wCurDecoration], a push hl call DecoAction_SetItUp jr c, .failed - ld a, 1 - ld [wBuffer5], a + ld a, TRUE + ld [wChangedDecorations], a pop hl ld a, [wMenuSelection] ld [hl], a @@ -661,7 +661,7 @@ DecoAction_TrySetItUp: DecoAction_SetItUp: ; See if there's anything of the same type already out - ld a, [wBuffer1] + ld a, [wCurDecoration] and a jr z, .nothingthere ; See if that item is already out @@ -673,7 +673,7 @@ DecoAction_SetItUp: ld a, [wMenuSelection] ld hl, wStringBuffer4 call GetDecorationName - ld a, [wBuffer1] + ld a, [wCurDecoration] ld hl, wStringBuffer3 call GetDecorationName ld hl, PutAwayAndSetUpText @@ -699,16 +699,16 @@ DecoAction_SetItUp: DecoAction_TryPutItAway: ; If there is no item of that type already set, there is nothing to put away. ld a, [hl] - ld [wBuffer1], a + ld [wCurDecoration], a xor a ld [hl], a - ld a, [wBuffer1] + ld a, [wCurDecoration] and a jr z, .nothingthere ; Put it away. - ld a, $1 - ld [wBuffer5], a - ld a, [wBuffer1] + ld a, TRUE + ld [wChangedDecorations], a + ld a, [wCurDecoration] ld [wMenuSelection], a ld hl, wStringBuffer3 call GetDecorationName @@ -729,8 +729,8 @@ DecoAction_setupornament: jr c, .cancel call DecoAction_SetItUp_Ornament jr c, .cancel - ld a, $1 - ld [wBuffer5], a + ld a, TRUE + ld [wChangedDecorations], a jr DecoAction_FinishUp_Ornament .cancel @@ -816,8 +816,8 @@ DecoAction_PutItAway_Ornament: jr z, .nothingthere ld hl, wStringBuffer3 call GetDecorationName - ld a, $1 - ld [wBuffer5], a + ld a, TRUE + ld [wChangedDecorations], a xor a ld [wSelectedDecoration], a ld hl, PutAwayTheDecoText @@ -843,9 +843,9 @@ DecoAction_AskWhichSide: call CopyMenuData jr c, .nope ld a, [wMenuCursorY] - cp 3 + cp 3 ; cancel jr z, .nope - ld [wBuffer2], a + ld [wSelectedDecorationSide], a call QueryWhichSide ld a, [hl] ld [wSelectedDecoration], a @@ -861,9 +861,10 @@ DecoAction_AskWhichSide: QueryWhichSide: ld hl, wDecoRightOrnament ld de, wDecoLeftOrnament - ld a, [wBuffer2] - cp 1 + ld a, [wSelectedDecorationSide] + cp 1 ; right side ret z + ; left side, swap hl and de push hl ld h, d ld l, e diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm index 4299a69ab..4bddc3292 100644 --- a/engine/overworld/time.asm +++ b/engine/overworld/time.asm @@ -261,15 +261,15 @@ DoMysteryGiftIfDayHasPassed: call OpenSRAM ld hl, sMysteryGiftTimer ld a, [hli] - ld [wBuffer1], a + ld [wTempMysteryGiftTimer], a ld a, [hl] - ld [wBuffer2], a + ld [wTempMysteryGiftTimer + 1], a call CloseSRAM - ld hl, wBuffer1 + ld hl, wTempMysteryGiftTimer call CheckDayDependentEventHL jr nc, .not_timed_out - ld hl, wBuffer1 + ld hl, wTempMysteryGiftTimer call InitOneDayCountdown call CloseSRAM farcall ResetDailyMysteryGiftLimitIfUnlocked @@ -277,7 +277,7 @@ DoMysteryGiftIfDayHasPassed: .not_timed_out ld a, BANK(sMysteryGiftTimer) call OpenSRAM - ld hl, wBuffer1 + ld hl, wTempMysteryGiftTimer ld a, [hli] ld [sMysteryGiftTimer], a ld a, [hl] |