From 75c6866309f007557918be4127bd1d5297800bda Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 22 Aug 2025 18:00:30 +0200 Subject: [PATCH] act_sg: now saving type as well to prevent actors from rendering for a frame when loading a map --- src/actsave.s | 19 ++++++++++++++++++- src/defs.s | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/actsave.s b/src/actsave.s index edd6598..437f642 100644 --- a/src/actsave.s +++ b/src/actsave.s @@ -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 diff --git a/src/defs.s b/src/defs.s index f2182dc..8f78c52 100644 --- a/src/defs.s +++ b/src/defs.s @@ -250,6 +250,7 @@ ; 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 -- 2.30.2