mapgen: disabled act sg during initial map load
authorLukas Krickl <lukas@krickl.dev>
Tue, 16 Sep 2025 09:53:56 +0000 (11:53 +0200)
committerLukas Krickl <lukas@krickl.dev>
Tue, 16 Sep 2025 09:53:56 +0000 (11:53 +0200)
src/debug.s
src/defs.s
src/mapgen.s
src/wram.s

index 177e6c2e312a907af66b0e2bf10b75639d153394..57fe9b8b3f0c585b58f1b2531ffdc9254ef13d1d 100644 (file)
@@ -88,12 +88,20 @@ debug_menu_init:
        ret
 
        ; debug new game routine
+       ; but load with a known hard-coded seed
        ;       returns:
        ;               bc: new state
 debug_fn_new_game:
+       ld a, 15
+       ld [srand], a
+       ld [srand+1], a
+
+       call new_game_init
        ld bc, st_update_game
        ret
 
 debug_fn_clear_actors:
        ld bc, st_update_game
        ret
+
+       
index bea62550449fd63517f3573fd424e37decbf72f3..43bce5f9f106f7d7c9211d9760d8f8c0ae15e85a 100644 (file)
 .def int DIRLEFT = BTNLEFT
 .def int DIRRIGHT = BTNRIGHT
 
+
+; mapgen flags
+.se 1
+.de MAPGEN_F_NO_ACT_SG, 1
index c1ed69918df15b1138b575faa2aac58d337ff73b..8b745846c86628d8a5a4f2135605e41018bdcd35 100644 (file)
@@ -5,10 +5,19 @@
        ; clears act_save
        ; also places initial door locations
 mapgen_init:
+       ; disable act sg
+       ld a, [mapgen_flags]
+       or a, MAPGEN_F_NO_ACT_SG
+       ld [mapgen_flags], a
+
        call act_save_init
        call mapgen_seed
        call mapgen_make_doors
        call mapgen_select_player_spawn
+
+       ; re-enable act sg
+       xor a, a
+       ld [mapgen_flags], a
        ret
        
        ; selects a room pattern table
@@ -100,8 +109,11 @@ mapgen_load_seed:
   ;   srand
 mapgen:
        call map_load_start
+       
+       ld a, [mapgen_flags]
+       and a, MAPGEN_F_NO_ACT_SG
+       call z, act_sg_store
 
-       call act_sg_store
   ; load seed
   ; and back it up
   ld a, [srand]
@@ -135,7 +147,9 @@ mapgen:
   ld b, a
   ld [srand], a
 
-       call act_sg_restore
+       ld a, [mapgen_flags]
+       and a, MAPGEN_F_NO_ACT_SG
+       call z, act_sg_restore
 
        call map_load_end
 
index 82691c4db1664195e7e8d709c58ba6dc5c84bbfd..0dcc1d425c3040adad0513f867d2df9880288a9f 100644 (file)
@@ -85,7 +85,10 @@ empty_oam: .adv oamsize
        
         ; > 0 if  an actor has an ongoing attack
         ; used to delay other actors during the animation
-gpf_attack_ongoing: .adv 0
+gpf_attack_ongoing: .adv 1 
+       
+       ; mapgen flags
+mapgen_flags: .adv 1
 
 
   ; can be used for custom state transtions