Fixed actor table loader
authorLukas Krickl <lukas@krickl.dev>
Fri, 25 Oct 2024 04:17:16 +0000 (06:17 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 25 Oct 2024 04:17:16 +0000 (06:17 +0200)
src/actor.s
src/map.s

index 7640f1600f4d90b64a6d7e20fe47b396c4b030cf..1741cfbb56d769d7fe3d6d05c50baf10a76cb1e2 100644 (file)
@@ -29,7 +29,7 @@ actors_update:
   pop de
 @skip:
   ; inc de sizeof(actor) times 
-.rep i, actor_size, 1, inc hl
+.rep i, actor_size, 1, inc de
   dec b
   ld a, b
   cp a, 0
index f6682d91738135a575a3172dc52d6491f2433af5..7983dca12e6c5823d0e7231dc8c782c802e99bec 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -48,17 +48,18 @@ room_load_actors:
   ; hl = ptr to initial actor table 
   ld hl, curr_room_init_act
   ld a, [hl+]
-  ld d, a
-  ld a, [hl]
   ld e, a
+  ld a, [hl]
+  ld d, a
   ; de = length...source table 
 
   ld b, 0
   ld a, [de]
-  ld e, a ; be = len
+  ld c, a ; bc = len
 
   inc de ; de = source table 
-  ld hl, actor_table ; hl = dst
+  ; hl = dst
+  ld hl, actor_table 
   call memcpy