WIP: actor table update
authorLukas Krickl <lukas@krickl.dev>
Mon, 25 Nov 2024 09:12:39 +0000 (10:12 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 25 Nov 2024 09:12:39 +0000 (10:12 +0100)
src/actor.s
src/macros.inc
src/player.s
src/wram.s

index 715715885908e77da8e69ca5c7605596db77f1d0..d36fef805bd22c849bc33417d26b23ac4044c16d 100644 (file)
   ; skips a turn by calling turn_finish
   ; and who_next
 #macro actor_skip_turn
-  call turn_finish 
+  turn_finish 
   call who_next
 #endmacro 
 
+
   ; stores hl back into soam ptr
 #macro actor_store_soam_ptr
   ; store soam ptr again
@@ -41,11 +42,11 @@ actor_update_table:
 
 actor_update_null:
   actor_check_who
-  jr nz, @skip REL
+  ret nz
   
-  actor_skip_turn
-@skip:
-  ret
+  actor_skip_turn
+  turn_finish
+  jp who_next
   
   ; bat actor 
 actor_update_bat:
@@ -155,8 +156,10 @@ actors_update:
   ld [act], a
 
   ld hl, actor_update_table
-  ld a, [bc] 
-  call call_tbl
+  ld a, [bc]
+  cp a, 0
+  call nz, call_tbl
+  call z, actor_update_null
 
   pop bc
   pop de
@@ -220,11 +223,6 @@ anim_move:
 
   ret
 
-  ; sets turn to end
-turn_finish:
-  ld a, 1
-  ld [end_turn], a
-  ret
 
   ; advance to the next actor if end_turn != 0
   ; effectively ending the current actor's turn
index 7275e50e1e015d98d9ac1580f255cd84e72aa218..e2ac287e4f9cacce6a41ac248db13750ea5254c1 100644 (file)
 #macro dwb 
 .db ($1 >> 8) & 0xFF 
 .db $1 & 0xFF
+#endmacro
+
+  ; sets turn to end
+#macro turn_finish
+  ld a, 1
+  ld [end_turn], a
 #endmacro
index dce99ca73d611a72e6de4a6a8cce8d96ac580d63..9fb75ee7b7979a9ad1d922b030062d8931e69ac1 100644 (file)
@@ -121,7 +121,7 @@ player_update:
     ld [tmp], a
     
     call play_noise
-    call turn_finish
+    turn_finish
 @notdown:
   
   input_held BTNUP
@@ -139,7 +139,7 @@ player_update:
     ld [tmp], a
 
     call play_noise
-    call turn_finish
+    turn_finish
 @notup:
   
 
@@ -160,7 +160,7 @@ player_update:
     ld [tmp+1], a
     
     call play_noise
-    call turn_finish
+    turn_finish
 @notleft:
 
   input_held BTNRIGHT
@@ -180,7 +180,7 @@ player_update:
     ld [tmp+1], a
 
     call play_noise
-    call turn_finish
+    turn_finish
 @notright:
 
 @action_buttons:
index 58b8a32630e7ba894464678cd728f5bf1eff3897..5e30e8d0c3f3d25251153bf908df4676509012f7 100644 (file)
@@ -9,7 +9,7 @@ shadow_oam: .adv OBJSMAX * oamsize
 frame_ready: .adv 1
 frame_count: .adv 1
 
-#define ACTORS_MAX 16
+#define ACTORS_MAX 8
 
   ; current frame's inputs 
 curr_inputs: .adv 1