From 6c844db7383db7f021a3ac6d43ed9d5a48acf5f6 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 17 Nov 2024 18:09:47 +0100 Subject: [PATCH] WIP: turn based movement --- src/mem.s | 7 ++++--- src/update.s | 4 ++++ src/wram.s | 10 ++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/mem.s b/src/mem.s index d5cd13c..7ca3754 100644 --- 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 diff --git a/src/update.s b/src/update.s index 0c314fc..bfc3d7a 100644 --- a/src/update.s +++ b/src/update.s @@ -2,6 +2,10 @@ update_table: dw update_game dw update_pause +dw update_game_over + +update_game_over: + ret update_game: ; update player diff --git a/src/wram.s b/src/wram.s index aaae8e7..c2dbc48 100644 --- a/src/wram.s +++ b/src/wram.s @@ -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 -- 2.30.2