aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-07-01 16:53:10 +0200
committerAstatin <[email protected]>2025-07-01 16:53:10 +0200
commit7ccc3f42244eef9385ba878f343a18852fab4dfa (patch)
treefe3feb43ad40a8e2e55b183997a56761538c9473
parentbcc4605c06e2b36698ae05eeda1f9078bfbcd2c7 (diff)
Make dungeon flag skip floor count, disable top bar & disable attack menu
-rw-r--r--entity/init.gbasm9
-rw-r--r--gui.gbasm3
-rw-r--r--main.gbasm16
-rw-r--r--map/loading/dungeoninfos.gbasm2
-rw-r--r--modes/dialoguemenu.gbasm17
-rw-r--r--modes/dungeon.gbasm20
-rw-r--r--modes/dungeongeneration.gbasm30
7 files changed, 83 insertions, 14 deletions
diff --git a/entity/init.gbasm b/entity/init.gbasm
index 6e75082..c67d782 100644
--- a/entity/init.gbasm
+++ b/entity/init.gbasm
@@ -26,6 +26,10 @@ Initialize_Entities:
LD A, $ff
LD $mem_bunny_current_room_idx, A
+ LD A, $mem_dungeon_flags
+ BIT 2, A
+ JP Z, =Reset_Entities_Collision_Map
+
LD A, $00
LD $tmp_var_3, A
CALL =Initialize_Enemy
@@ -37,7 +41,6 @@ Initialize_Entities:
LD $mem_bunny_current_room_idx, A
JP =Reset_Entities_Collision_Map
- RET
Initialize_Bunny_Random_room:
LD A, $ff
@@ -211,6 +214,10 @@ FindFreeEntity:
RET
Respawn_Entities:
+ LD A, $mem_dungeon_flags
+ BIT 2, A
+ RET Z
+
LD A, $mem_moving_animation_step
CP $04
RET NZ
diff --git a/gui.gbasm b/gui.gbasm
index a3e89e1..1cc94c4 100644
--- a/gui.gbasm
+++ b/gui.gbasm
@@ -299,6 +299,9 @@ Check_dialogue_action:
RET
Check_Open_Menu_button:
+ LD A, $mem_dungeon_flags
+ BIT 4, A
+ RET Z
LD A, $mem_current_mode
CP $enum_dungeon_mode
RET NZ
diff --git a/main.gbasm b/main.gbasm
index cce2831..d68c342 100644
--- a/main.gbasm
+++ b/main.gbasm
@@ -31,6 +31,22 @@
LD A, $lcdc_guibg_tilemap
OR E
LD $reg_lcd_controller, A
+
+ LD A, $palette_bold_font
+ LD $reg_bg_palette, A
+.END
+
+.MACRODEF DISABLE_TOP_BAR
+ LD A, $mem_prepared_viewport_x
+ LD $reg_viewport_x, A
+ LD A, $mem_prepared_viewport_y
+ LD $reg_viewport_y, A
+ LD A, $mem_prepared_color_palette
+ LD $reg_bg_palette, A
+
+ LD A, $lcdc_mapbg_tilemap
+ OR E
+ LD $reg_lcd_controller, A
.END
.MACRODEF ENABLE_DIALOGUE
diff --git a/map/loading/dungeoninfos.gbasm b/map/loading/dungeoninfos.gbasm
index c43a20b..928ce6f 100644
--- a/map/loading/dungeoninfos.gbasm
+++ b/map/loading/dungeoninfos.gbasm
@@ -24,7 +24,7 @@ Load_Dungeon_Infos: ; pointer to Dungeon struct in HL, bank in A
SUB B
SRA A
- LD HL, $9e80
+ LD HL, $9ea0
ADD L
LD L, A
LD A, H
diff --git a/modes/dialoguemenu.gbasm b/modes/dialoguemenu.gbasm
index 4f8e410..ad0b3be 100644
--- a/modes/dialoguemenu.gbasm
+++ b/modes/dialoguemenu.gbasm
@@ -1,9 +1,22 @@
Dialogue_VBLANK_Entrypoint:
.SET_WINDOW_LCDC_E
+ LD A, $mem_dungeon_flags
+ BIT 3, A
+ JR NZ, =.top_bar.enable
+
+ .DISABLE_TOP_BAR
+
+ LD A, $67
+ LD $reg_lyc, A
+
+ JR =.top_bar.end
+ .top_bar.enable:
+
.ENABLE_TOP_BAR
- LD A, $palette_bold_font
- LD $reg_bg_palette, A
+ LD A, $0a
+ LD $reg_lyc, A
+ .top_bar.end:
CALL $OAM_DMA_Transfer_routine
diff --git a/modes/dungeon.gbasm b/modes/dungeon.gbasm
index 14d0381..1d27cc1 100644
--- a/modes/dungeon.gbasm
+++ b/modes/dungeon.gbasm
@@ -112,10 +112,24 @@ STAT_Entrypoint:
Dungeon_VBLANK_Entrypoint:
.SET_WINDOW_LCDC_E
+
+ LD A, $mem_dungeon_flags
+ BIT 3, A
+ JR NZ, =.top_bar.enable
+
+ .DISABLE_TOP_BAR
+
+ LD A, $67
+ LD $reg_lyc, A
+
+ JR =.top_bar.end
+ .top_bar.enable:
+
.ENABLE_TOP_BAR
- LD A, $palette_bold_font
- LD $reg_bg_palette, A
+ LD A, $0a
+ LD $reg_lyc, A
+ .top_bar.end:
CALL $OAM_DMA_Transfer_routine
@@ -135,8 +149,6 @@ Dungeon_VBLANK_Entrypoint:
Skip_VBlank_Dungeon_Update:
; LYC
- LD A, $0a
- LD $reg_lyc, A
.ENABLE_LYC_INTERRUPT
.RESET_INTERRUPTS
EI
diff --git a/modes/dungeongeneration.gbasm b/modes/dungeongeneration.gbasm
index 522ab1a..bfbe58c 100644
--- a/modes/dungeongeneration.gbasm
+++ b/modes/dungeongeneration.gbasm
@@ -42,19 +42,37 @@ New_Floor:
LD SP, $fffe
LD A, $00
- LD $reg_viewport_x, A
- LD A, $68
- LD $reg_viewport_y, A
+ LD $mem_display_flag, A
LD A, $00
- LD $mem_display_flag, A
+ LD $reg_viewport_x, A
+
+ LD A, $mem_dungeon_flags
+ BIT 1, A
+ JR Z, =.floor_count.disabled
+
+ .floor_count.enabled:
+ LD A, $70
+ LD $reg_viewport_y, A
LD A, $f4
- LD ($9ecb), A
+ LD ($9eeb), A
- LD HL, $9ec9
+ LD HL, $9ee9
LD A, $mem_floor_count
CALL =Print_8bit
+ JR =.floor_count.end
+
+ .floor_count.disabled:
+ LD A, $68
+ LD $reg_viewport_y, A
+
+ LD A, $00
+ LD ($9ee9), A
+ LD ($9eea), A
+ LD ($9eeb), A
+
+ .floor_count.end:
LD A, $07
LD $reg_bg_palette, A