From 3649b73eca599701db818dbbf470b1b17e660083 Mon Sep 17 00:00:00 2001 From: Astatin Date: Fri, 7 Mar 2025 15:01:07 +0900 Subject: Fix walk on deleted objects + fix out of vblank on dialogue close and object draw --- TODO | 5 +++++ entity/actions.gbasm | 10 ++++++++++ main.gbasm | 6 +++--- map/objects.gbasm | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index babb6aa..c9edb83 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,11 @@ Bugs: -> Emulator crash with "not implemented: Only XKB keymaps are supported when unfocused (or workspace change maybe ?) -> There is no indicator that the max health is 20 + -> object tile only is getting removed, not the effect + -> hop cancelled uses EPs + -> freeze/earcopter attack patterns are not obvious (either needs to be shown on map or add select menu with infos if not possible + tutorial to explain the existence of select menu ?) + -> when stairs spawn in the same room as the bunny, it's not obvious that it's not the stairs we just came from + -> B + arrow is not obvious (tutorial ?) Need to be refactored: -> main is messy and unreadable diff --git a/entity/actions.gbasm b/entity/actions.gbasm index 11951e6..7032766 100644 --- a/entity/actions.gbasm +++ b/entity/actions.gbasm @@ -81,6 +81,16 @@ Update_Animation_Steps: .update_mode: + ; We need to make sure that the mode doesn't change to a mode with objects update while a dialogue box refresh is currently being done + LD A, $mem_current_mode + BIT 7, A + JR Z, =.set_current_mode + LD A, $mem_display_flag + AND 0b00010100 + CP $00 + JR NZ, =.end + + .set_current_mode: LD A, $mem_requested_mode LD $mem_current_mode, A diff --git a/main.gbasm b/main.gbasm index 177a6db..6cff1bc 100644 --- a/main.gbasm +++ b/main.gbasm @@ -65,6 +65,9 @@ .END .MACRODEF ENABLE_VBLANK_INTERRUPTS + LD A, $reg_interrupt_flags + RES 0, A + LD $reg_interrupt_flags, A LD A, $03 LD $reg_interrupt_enable, A .END @@ -154,7 +157,6 @@ New_Dungeon: .SET_WINDOW_LCDC_E .ENABLE_TOP_BAR .ENABLE_VBLANK_INTERRUPTS - .HBLANK_WAIT EI Wait_for_Interrupt.loop: HALT @@ -162,7 +164,6 @@ New_Dungeon: JP =Wait_for_Interrupt.loop VBLANK_Entrypoint: - DBG .SET_WINDOW_LCDC_E .ENABLE_TOP_BAR @@ -202,7 +203,6 @@ VBLANK_Entrypoint: .skip_stop: LD $dbg_var A - DBG ; LYC LD A, $0a LD $reg_lyc, A diff --git a/map/objects.gbasm b/map/objects.gbasm index b1a43fe..1745092 100644 --- a/map/objects.gbasm +++ b/map/objects.gbasm @@ -344,6 +344,8 @@ Object_Interactions_Check: LD A, (HL+) CP $00 JR Z, =.next + CP $FF + JR Z, =.next LD A, (HL+) CP C -- cgit v1.2.3-70-g09d2