unit: removed dice display
authorLukas Krickl <lukas@krickl.dev>
Sat, 21 Jun 2025 15:37:12 +0000 (17:37 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sat, 21 Jun 2025 15:37:12 +0000 (17:37 +0200)
src/actortables.s
src/defs.s
src/macros.inc
src/unit.s

index 331ecc8c521ed620d34c18fcba6b24979cb696c4..511da3df8f0be5062150465459f0aac3e23e022d 100644 (file)
@@ -1,9 +1,22 @@
 #include "unit_demo.s"
 
 default_map_actor_table:
-.db 2 ; size
+.db 19 ; size
 dw unit_demo_2
 dw unit_demo_3
-
-
-
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
+dw unit_demo_3
index b70653412adc6c74cb6b900465c46023b770de74..d7fcc8c59cbed037188fa61191fb47e2aaa6b798 100644 (file)
@@ -9,7 +9,7 @@
 
 #define NULL 0
 
-#define UNITS_MAX 12
+#define UNITS_MAX 20
 
 #define STACK_BEGIN 0xDFFF
 
 
   ; actor runtime values
 
-  ; dice display
-  ; if timer > 0 the default draw
-  ; call will draw a dice instead of the regular 
-  ; sprite
-.de act_rt_dd_d16, 1 ; dice display value
-.de act_rt_dd_timer, 1
-.de act_rt_dd_flags, 1
   ; last collision with actor
   ; set during unit_collision_woth_any_other
 .de act_rt_collided_with, 2
index 5ec9ae7611252e0d5ff6c467651754b4eac024b4..0a9b1efdf72a815dcb0204269a74e722b4e447c9 100644 (file)
   ; defines default values for actor runtime values
   ; these can generally not be set at build time
 #macro act_rt_def
-  .db 0, 0, 0 ; act_rt_dd_*
   ; act_rt_collided_woth
   dw 0 
 #endmacro
index 6b6676227aed81f5ccab78d12b618bf70432ddb1..a283f3990abe4b8380a6e6cd322757fc61bac5c4 100644 (file)
@@ -67,16 +67,6 @@ unit_update_draw:
   ; inputs
   ;   de: actor
 unit_draw:
-  ; first check if dd_timer is set
-  push de
-  ld hl, act_rt_dd_timer
-  add hl, de
-  ld a, [hl]
-  cp a, 0
-  pop de
-  jp nz, @unit_draw_dd
-
-
   push de
   ld hl, act_oam_tile
   add hl, de ; hl = tile 
@@ -90,36 +80,6 @@ unit_draw:
   ldnull bc
   ret
 
-@unit_draw_dd:
-  push de
-  
-  ld hl, act_rt_dd_d16
-  add hl, de
-  ; hl = d16
-  ld a, [hl+] ; a = tile
-  ; TODO: handle flags if ever needed 
-  
-  
-  pop de
-  push de
-  
-  ld b, a ; tile
-  ld c, 0 ; tile flags
-  call unit_generic_draw
-  
-  ; timer--
-  pop de 
-  push de
-  ld hl, act_rt_dd_timer
-  add hl, de ; de = timer
-  ld a, [hl]
-  dec a
-  ld [hl], a
-
-  pop de
-  ldnull bc
-  ret
-
   ; draws any unit
   ; inputs:
   ;  de: actor
@@ -546,44 +506,6 @@ unit_get_pos:
   ld c, a ; c = x
   ret
 
-  ; sets dice display at current unit's location
-  ; inputs:
-  ;   hl: unit
-  ; preserves all registers
-unit_dice_display_set_hl:
-  push de 
-  push hl
-  pop de ; de = unit now
-  call unit_dice_display_set 
-  pop de ; de is restored
-  ret
-
-  ; same as unit_dice_display_set_hl 
-  ; but follows the regular calling conventions
-  ; inputs:
-  ;   de: unit
-  ; preserves all registers
-unit_dice_display_set:
-  push_all
-
-  ld hl, act_rt_dd_d16
-  add hl, de ; hl = actor's dd runtime values 
-
-  ld b, DD_D0_TILE
-  ld a, [d16]
-  add a, b ; d0 + roll value of d16
-  ld [hl+], a ; store tile to draw 
-  
-  ld a, DD_TIME
-  ld [hl+], a ; set timer
-
-  xor a, a
-  ; no flags
-  ld [hl+], a
-
-  pop_all
-  ret
-
   ; TODO:
   ; returns:
   ;   hl: inventory ptr