act_sg: now saving type as well to prevent actors from rendering for a frame when...
authorLukas Krickl <lukas@krickl.dev>
Fri, 22 Aug 2025 16:00:30 +0000 (18:00 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 22 Aug 2025 16:00:30 +0000 (18:00 +0200)
src/actsave.s
src/defs.s

index edd6598ae0006a9f668305c5881eea88ca4ebf65..437f642171df08630fb1912c6f48894e0e331feb 100644 (file)
@@ -28,7 +28,6 @@ act_sg_load_current_slot:
 @done:
        push hl
        pop bc ; we want return value in bc
-       BREAK
 
        ret
 
@@ -60,6 +59,15 @@ act_sg_store:
        ;               hl: next actor
        ;               bc: next slot
 act_sg_store_single:
+       ; store type
+       push hl
+       ld de, act_type
+       add hl, de
+       ld a, [hl]
+       ld [bc], a
+       inc bc
+       pop hl
+
        push hl
        ; store flags
        ld de, act_flags
@@ -146,6 +154,15 @@ act_sg_restore_single:
        cp a, 0xFF
        jp z, @skip ; skip if 0xFF
 
+       ; load type
+       push hl
+       ld de, act_type
+       add hl, de
+       ld a, [bc]
+       ld [hl], a
+       inc bc
+       pop hl
+
        push hl
        ; load flags
        ld de, act_flags
index f2182dc0c00b89737c919cd38534bccc92e99c8d..8f78c52eeac3a3381be2ebbbb4e5cd09b7bcccff 100644 (file)
        ; if pos y and x is 0xFF 
        ; it is not restored
 .se 0
+.de act_sg_type, 1
 .de act_sg_flags, 1
 .de act_sg_pos_y, 1
 .de act_sg_pos_x, 1