object animation: added stub for object animations
authorLukas Krickl <lukas@krickl.dev>
Fri, 8 Aug 2025 04:38:09 +0000 (06:38 +0200)
committerLukas Krickl <lukas@krickl.dev>
Fri, 8 Aug 2025 04:38:09 +0000 (06:38 +0200)
This system will allow playing simple animations e.g. when a door opens.

src/defs.s
src/main.s
src/mem.s
src/objanim.s [new file with mode: 0644]
src/wram.s

index ce128fd1f0742270c64846a8c11253790a2451ab..b12ada45c80ad0db315cfdbbef7ab474b2de9ca1 100644 (file)
   ; pointer to new map struct
 .de exit_to, 2
 .de exit_size, 0
+       
+       ; object animation struct
+       ; simple call in update code
+       ; with a single state
+       ; intended for use with short-term map animations
+       ; e.g. door opening
+.se 0
+.de obja_st, st_size
+.de obja_flags, 1
+.de obja_pos_y, 1
+.de obja_pos_x, 1
+.de obja_dat, 1
+.de obja_size, 0
 
 ; special text commands
 
 ; byte as a number
 #define TEXT_NUMBER 0x80
 
-  ; dice display
-
   ; constants
-#define DD_TIME 90 
-#define DD_D0_TILE 0x90 
-#define DD_CROSS_TILE 0xA0
 
 #define DISTANCE_BGTA 1
 #define DISTANCE_AGTB 0
index 2972f722dd933eba4136ddecbf4881b6ba435bf3..677a7f4e3ab8d3e44c6e3cfbd45837252ac02218 100644 (file)
@@ -76,6 +76,7 @@ main:
 #include "demos.s"
 #include "mainmenu.s"
 #include "actsave.s"
+#include "objanim.s"
 
 ; fill bank
 .fill 0xFF, 0x4000 - $
index cd99e3eeda2460697ec574db93b1bb114e7139c8..7ffb0e10e6058ec27e3adf8e1d54a83f2a08a58c 100644 (file)
--- a/src/mem.s
+++ b/src/mem.s
@@ -32,7 +32,8 @@ mem_init:
   ld hl, st_unit_delay_to_active
   ld bc, st_size
   call memcpy
-
+       
+       call objanim_init
   
   ; set up default game speed
   ld a, GAME_SPEED_DEFAULT
diff --git a/src/objanim.s b/src/objanim.s
new file mode 100644 (file)
index 0000000..d13fca2
--- /dev/null
@@ -0,0 +1,4 @@
+
+       ; sets up object animation state
+objanim_init:
+       ret
index 65491e1292f68cde4f0ee22f8e91cd571aeabec9..e3c79902738ab3b399a5452432845ebbe16d5aea 100644 (file)
@@ -73,8 +73,6 @@ redraw_steps: .adv 1
 ; same memory as empty_unit
 empty_oam: .adv oamsize
 
-  ; ptr to actor for next UI update
-ui_draw_actor: .adv 2
 
   ; can be used for custom state transtions
   ; simple write state info to this location 
@@ -94,6 +92,9 @@ scroll_x: .adv 1
   ; allows us to move scroll when needed 
 scroll_move_y: .adv 1
 scroll_move_x: .adv 1
+       
+       ; state for object animation
+objanim: .adv obja_size
 
   ; game state
   ; this region holds the entire game state