aboutsummaryrefslogtreecommitdiff
path: root/modes
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-06-17 17:42:44 +0200
committerAstatin <[email protected]>2025-06-17 17:42:44 +0200
commitb84a1c2c0ebb484e23753c2f9db8742389fcc99a (patch)
tree0036439ad1a5cc4c08c4bef79c0255b851a894f2 /modes
parenta9142d0163f41c89196ea201ce8245899c701b82 (diff)
loading ldtk tilemaps + adding dungeon structure that can be loaded at runtime
Diffstat (limited to 'modes')
-rw-r--r--modes/dungeongeneration.gbasm36
-rw-r--r--modes/maploading.gbasm14
-rw-r--r--modes/vblank_handler_list.gbasm4
3 files changed, 41 insertions, 13 deletions
diff --git a/modes/dungeongeneration.gbasm b/modes/dungeongeneration.gbasm
index 172093f..b9d40ef 100644
--- a/modes/dungeongeneration.gbasm
+++ b/modes/dungeongeneration.gbasm
@@ -22,6 +22,30 @@
.END
New_Dungeon:
+ LD A, $20
+ LD $mem_bunny_health, A
+ LD A, $30
+ LD $mem_bunny_mana, A
+ LD A, $01
+ LD $mem_floor_count, A
+ LD A, $00
+ LD $mem_floor_count_bin, A
+
+ LD A, ($mem_dungeon+1)
+ LD H, A
+ LD A, ($mem_dungeon+2)
+ LD L, A
+ LD A, ($mem_dungeon)
+ CALL =Load_Dungeon_Txt
+
+ LD A, ($mem_dungeon+1)
+ LD H, A
+ LD A, ($mem_dungeon+2)
+ LD L, A
+ LD A, ($mem_dungeon)
+ CALL =Load_Generation_Events
+
+New_Floor:
LD SP, $fffe
LD A, $00
@@ -32,10 +56,6 @@ New_Dungeon:
LD A, $00
LD $mem_display_flag, A
- LD A, bank(=Dungeon)
- LD HL, ptr(=Dungeon)
- CALL =Load_Dungeon_Txt
-
LD A, $f4
LD ($9ecb), A
@@ -51,9 +71,11 @@ New_Dungeon:
CALL =Reset_Map
-
- LD A, bank(=Dungeon)
- LD HL, ptr(=Dungeon)
+ LD A, ($mem_dungeon+1)
+ LD H, A
+ LD A, ($mem_dungeon+2)
+ LD L, A
+ LD A, ($mem_dungeon)
CALL =Load_Dungeon_Spawn_patterns
LD A, $entity_questgoalbunny_index
LD $mem_loaded_special_entity_index, A
diff --git a/modes/maploading.gbasm b/modes/maploading.gbasm
index 72f24ed..ab8ecbe 100644
--- a/modes/maploading.gbasm
+++ b/modes/maploading.gbasm
@@ -32,8 +32,11 @@ Map_Loading:
LD A, $00
LD $mem_display_flag, A
- LD A, bank(=Dungeon)
- LD HL, ptr(=Dungeon)
+ LD A, ($mem_dungeon+1)
+ LD H, A
+ LD A, ($mem_dungeon+2)
+ LD L, A
+ LD A, ($mem_dungeon)
CALL =Load_Dungeon_Txt
LD A, $f4
@@ -57,8 +60,11 @@ Map_Loading:
LD DE, ptr(=_map_Test)
CALL =memcpy
- LD A, bank(=Dungeon)
- LD HL, ptr(=Dungeon)
+ LD A, ($mem_dungeon+1)
+ LD H, A
+ LD A, ($mem_dungeon+2)
+ LD L, A
+ LD A, ($mem_dungeon)
CALL =Load_Dungeon_Spawn_patterns
LD A, $entity_questgoalbunny_index
LD $mem_loaded_special_entity_index, A
diff --git a/modes/vblank_handler_list.gbasm b/modes/vblank_handler_list.gbasm
index 99db063..004c782 100644
--- a/modes/vblank_handler_list.gbasm
+++ b/modes/vblank_handler_list.gbasm
@@ -26,8 +26,8 @@ VBlank_Handler_List:
; 2 (loading, animation)
.DB =Loading_VBLANK_Entrypoint
- ; 3 (new dungeon)
- .DB =New_Dungeon
+ ; 3 (new floor)
+ .DB =New_Floor
; 4 (pregenerated map loading)
.DB =Map_Loading