aboutsummaryrefslogtreecommitdiff
path: root/main.gbasm
diff options
context:
space:
mode:
authorAstatin <[email protected]>2024-11-01 22:07:56 +0900
committerAstatin <[email protected]>2024-11-01 22:07:56 +0900
commit17a186217dbf12e344e90537d50f713e3c5a6416 (patch)
tree99b0c5080738ff52fdcd531e1cfae491585b4127 /main.gbasm
parent3a68266a7c97a1dff3938eb9d96e41657a230424 (diff)
Fix windows display and stairs on sameboy
Diffstat (limited to 'main.gbasm')
-rw-r--r--main.gbasm14
1 files changed, 11 insertions, 3 deletions
diff --git a/main.gbasm b/main.gbasm
index a4ce1fc..38359a9 100644
--- a/main.gbasm
+++ b/main.gbasm
@@ -13,8 +13,7 @@
$HBlank_Wait.End:
.END
-.MACRODEF ENABLE_WINDOW
- .HBLANK_WAIT
+.MACRODEF ENABLE_WINDOW_NO_WAIT_HBLANK
XOR A
LD $reg_viewport_x, A
LD $reg_viewport_y, A
@@ -26,6 +25,11 @@
LD $reg_lcd_controller, A
.END
+.MACRODEF ENABLE_WINDOW
+ .HBLANK_WAIT
+ .ENABLE_WINDOW_NO_WAIT_HBLANK
+.END
+
.MACRODEF DISABLE_WINDOW
PUSH BC
LD A, $mem_prepared_viewport_x
@@ -80,6 +84,9 @@ New_Dungeon:
CALL =Load_Map
CALL =Load_Objects
+ LD A, $00
+ LD $mem_display_flag, A
+ .ENABLE_WINDOW_NO_WAIT_HBLANK
.ENABLE_VBLANK_INTERRUPTS
EI
Wait_for_VRAM.loop:
@@ -88,6 +95,7 @@ New_Dungeon:
JP =Wait_for_VRAM.loop
VBLANK_Entrypoint:
+ .ENABLE_WINDOW_NO_WAIT_HBLANK
LD HL, $9c00
LD A, $mem_bunny_health
CALL =Print_8bit
@@ -99,11 +107,11 @@ VBLANK_Entrypoint:
CALL =Display_Object
CALL $OAM_DMA_Transfer_routine
- .ENABLE_WINDOW
; LYC
LD A, $09
LD $reg_lyc, A
.ENABLE_LYC_INTERRUPT
+ .RESET_STAT_INTERRUPT
EI
CALL =Object_Interactions_Check