WIP: turn based movement
authorLukas Krickl <lukas@krickl.dev>
Sun, 17 Nov 2024 17:09:47 +0000 (18:09 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 17 Nov 2024 17:09:47 +0000 (18:09 +0100)
src/mem.s
src/update.s
src/wram.s

index d5cd13c5e94b0f555c558908558271647f12664b..7ca3754d45a969f57be5eb7046693441a2b31cb8 100644 (file)
--- a/src/mem.s
+++ b/src/mem.s
@@ -15,6 +15,10 @@ mem_init:
   ld a, GM_GAME
   ld [game_mode], a
 
+  ; player starts the turn
+  ld a, WHO_PLAYER
+  ld [who], a
+
   call mbc1_init
 
   ret
@@ -72,9 +76,6 @@ shadow_oam_to_oam_end:
 ; MBC1 functions
 ; ==============
 
-  ; if the first byte of sram is not this 
-  ; value clear it all
-#define MBC1_SRAM_MAGIC 0xA1 
 
 mbc1_init:
   call mbc1_ram_enable
index 0c314fc0fa0b6ad1d8e287521875ba6578251ac3..bfc3d7a29762b72b1a760cf82fd6e5433e35c51c 100644 (file)
@@ -2,6 +2,10 @@
 update_table:
 dw update_game
 dw update_pause
+dw update_game_over
+
+update_game_over:
+  ret
 
 update_game:
   ; update player
index aaae8e77fa7aec823e752973451855219833006a..c2dbc4803f3822b241ee43848cf59033576dc15c 100644 (file)
@@ -142,6 +142,16 @@ game_over_timer: .adv 1
 
 game_mode: .adv 1
 
+
+#define WHO_PLAYER 0xFF
+  ; who is currently in control of the game
+  ; if set to FF
+  ; the player is active 
+  ; otherwise it is the actor index 
+  ; actors may still run update code like animations 
+  ; but may *never* act when they are not currently enabled 
+who: .adv 1
+
   ; collision tile tmp values  
 ct_poy: .adv 1
 ct_pox: .adv 1