aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-04-08 14:15:40 +0200
committerAstatin <[email protected]>2025-04-08 14:15:40 +0200
commit51bdddd2ee8357950d785a60b887730368527277 (patch)
treea42d8b10221605c77240004795f227988b21a9c2
parent85c478d0c2368c0a38fa3e6aa4d4e9070ea63fc3 (diff)
Fix frame specific and sameboy specific bug with loading screens
-rw-r--r--TODO4
-rw-r--r--main.gbasm10
-rw-r--r--modes/dialoguemenu.gbasm2
-rw-r--r--modes/dungeon.gbasm6
-rw-r--r--modes/dungeongeneration.gbasm15
-rw-r--r--modes/loading.gbasm2
-rw-r--r--tiles.gbasm2
7 files changed, 24 insertions, 17 deletions
diff --git a/TODO b/TODO
index 02eadd1..00f4350 100644
--- a/TODO
+++ b/TODO
@@ -38,7 +38,7 @@ x -> Add other types of enemies
x * Fox with distance limited attack and close unlimited attack
x * Penguin freezing and fleeing when the player is frozen
* Mouse weaker and only close attacks but can move 2x faster
- * Cats being normal (only close attacks)
+x * Cats being normal (only close attacks)
* Fimsh being super rare have a bunch of HP, not do anything but drop super cool objects
* Owls heal the enemies around (different pathfinding where it tries to stay 1 block away from the bnuy?) + cooldown
* Bugs move 2x faster and sacrifice themselves to give the bunny a status (poisoned & taking damages/slower and skipping one of 2 turns)
@@ -46,7 +46,7 @@ x * Penguin freezing and fleeing when the player is frozen
-> Have some enemies drop items
- -> Add floor count + a kind of goal (rescuing another bunny/getting a rare item ?)
+x -> Add floor count + a kind of goal (rescuing another bunny/getting a rare item ?)
DEMO
diff --git a/main.gbasm b/main.gbasm
index 21b9420..ee3500f 100644
--- a/main.gbasm
+++ b/main.gbasm
@@ -68,13 +68,13 @@
LD A, $reg_interrupt_flags
RES 0, A
LD $reg_interrupt_flags, A
- LD A, $03
+ LD A, $reg_interrupt_enable
+ OR $01
LD $reg_interrupt_enable, A
.END
-.MACRODEF RESET_STAT_INTERRUPT
- LD A, $reg_interrupt_flags
- RES 1, A
+.MACRODEF RESET_INTERRUPTS
+ LD A, $00
LD $reg_interrupt_flags, A
.END
@@ -83,7 +83,7 @@
LD ($mem_stat_jump_destination), A
LD A, high(=STAT_Entrypoint)
LD ($mem_stat_jump_destination+1), A
- .RESET_STAT_INTERRUPT
+ .RESET_INTERRUPTS
LD A, $40
LD $reg_lcd_status, A
LD A, $02
diff --git a/modes/dialoguemenu.gbasm b/modes/dialoguemenu.gbasm
index 5138c40..4f8e410 100644
--- a/modes/dialoguemenu.gbasm
+++ b/modes/dialoguemenu.gbasm
@@ -15,7 +15,7 @@ Dialogue_VBLANK_Entrypoint:
LD A, $0a
LD $reg_lyc, A
.ENABLE_LYC_INTERRUPT
- .RESET_STAT_INTERRUPT
+ .RESET_INTERRUPTS
EI
CALL =Pad_Button_Check
diff --git a/modes/dungeon.gbasm b/modes/dungeon.gbasm
index 41fc11d..bd3515e 100644
--- a/modes/dungeon.gbasm
+++ b/modes/dungeon.gbasm
@@ -88,7 +88,7 @@ STAT_Entrypoint:
LD $reg_bg_palette, A
LD A, $77
LD $reg_lyc, A
- .RESET_STAT_INTERRUPT
+ .RESET_INTERRUPTS
POP DE
POP AF
RETI
@@ -103,7 +103,7 @@ STAT_Entrypoint:
.DISABLE_DIALOGUE
LD A, $67
LD $reg_lyc, A
- .RESET_STAT_INTERRUPT
+ .RESET_INTERRUPTS
POP DE
POP AF
RETI
@@ -136,7 +136,7 @@ Dungeon_VBLANK_Entrypoint:
LD A, $0a
LD $reg_lyc, A
.ENABLE_LYC_INTERRUPT
- .RESET_STAT_INTERRUPT
+ .RESET_INTERRUPTS
EI
CALL =Pad_Button_Check
diff --git a/modes/dungeongeneration.gbasm b/modes/dungeongeneration.gbasm
index 1588e81..c119338 100644
--- a/modes/dungeongeneration.gbasm
+++ b/modes/dungeongeneration.gbasm
@@ -7,7 +7,7 @@
LD ($mem_stat_jump_destination), A
LD A, high(=Dungeon_generation_Out_Of_VBlank)
LD ($mem_stat_jump_destination+1), A
- .RESET_STAT_INTERRUPT
+ .RESET_INTERRUPTS
LD A, $20
LD $reg_lcd_status, A
LD A, $02
@@ -125,6 +125,8 @@ New_Dungeon:
CALL =Load_Prepared_Map
+ CALL =VBlank_Wait
+
Dungeon_generation_VBlank:
.ENABLE_MODE_2_INTERRUPT
EI
@@ -141,7 +143,9 @@ Dungeon_generation_VBlank:
LD A, $f4
LD ($9d73), A
+ LD B, B
CALL =Reload_Entities_Tile_Data
+ LD B, B
; Clear OAM
LD HL, $fe00
LD BC, $00a0
@@ -164,14 +168,14 @@ Dungeon_generation_VBlank:
CALL =Reset_Entities_Collision_Map
- .SET_WINDOW_LCDC_E
.ENABLE_VBLANK_INTERRUPTS
- .RESET_STAT_INTERRUPT
- LD A, $00
- LD $reg_interrupt_flags, A
+ .RESET_INTERRUPTS
+ LD A, $lcdc_mapbg_tilemap
+ LD $reg_lcd_controller, A
EI
Wait_for_Interrupt.loop:
+ LD A, $reg_lcd_status
HALT
JP =Wait_for_Interrupt.loop
@@ -179,5 +183,6 @@ Dungeon_generation_Out_Of_VBlank:
PUSH AF
CALL =VBlank_Wait
.ENABLE_MODE_2_INTERRUPT
+ .RESET_INTERRUPTS
POP AF
RETI
diff --git a/modes/loading.gbasm b/modes/loading.gbasm
index dea6e89..df1bd24 100644
--- a/modes/loading.gbasm
+++ b/modes/loading.gbasm
@@ -12,7 +12,7 @@ Loading_VBLANK_Entrypoint:
LD A, $0a
LD $reg_lyc, A
.ENABLE_LYC_INTERRUPT
- .RESET_STAT_INTERRUPT
+ .RESET_INTERRUPTS
EI
CALL =Pad_Button_Check
diff --git a/tiles.gbasm b/tiles.gbasm
index bc5e6e6..5d82543 100644
--- a/tiles.gbasm
+++ b/tiles.gbasm
@@ -69,8 +69,10 @@ Reload_Entities_Tile_Data:
LD A, (BC)
LD E, A
+ LD B, B
LD BC, $00c0
CALL =memcpy
+ LD B, B
POP DE
POP HL