map: WIP actor table saving
authorLukas Krickl <lukas@krickl.dev>
Thu, 2 Jan 2025 14:34:40 +0000 (15:34 +0100)
committerLukas Krickl <lukas@krickl.dev>
Thu, 2 Jan 2025 14:34:40 +0000 (15:34 +0100)
src/map.s

index 9b8113bd2f2d03d5e8a25e290b4af072ca982ad7..117259b5f3108a594f533b9880ab06c3d80a37a3 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -160,7 +160,25 @@ room_goto_player_pos:
   ;   curr_room_exits: ptr to exits table
   ;   a: direction EAST, WEST, NORTH, SOUTH, EXIT_SPECIAL
 room_goto:
-  ; TODO: save current tables back 
+  ; TODO: save current tables back
+  push af
+  
+  ; dst = original actor table 
+  ld hl, curr_room_actor_table 
+  ld a, [hl+]
+  ld d, a
+  ld a, [hl+]
+  ld h, a
+  ld l, d
+
+  ; src = actor_table 
+  ld de, actor_table
+  ld bc, ACTOR_TABLE_SIZE
+  ; TODO fix actor table saving 
+  ; call memcpy
+
+  pop af
+
   ; save a for later
   push af
   call disableinterrutpts