From b26934b801d8f5c4e4e98dab47aa609b6e3464fd Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Mon, 18 Nov 2024 19:18:33 +0100 Subject: [PATCH] Added skip turn code to all other actor types for now --- src/actor.s | 29 +++++++++++++++++++++++++++++ src/wram.s | 3 +++ 2 files changed, 32 insertions(+) diff --git a/src/actor.s b/src/actor.s index 1470ae1..b23b5c3 100644 --- a/src/actor.s +++ b/src/actor.s @@ -8,9 +8,33 @@ actor_update_table: dw actor_update_rock actor_update_null: + ; if who is current actor simply + ; skip + ld a, [act] + ld b, a + ld a, [who] + cp a, b + jr nz, @skip REL + + call turn_finish + call who_next + +@skip: ret actor_update_rock: + + ld a, [act] + ld d, a + ld a, [who] + cp a, d + jr nz, @skip REL + + call turn_finish + call who_next + +@skip: + ; load oam ptr ld a, [actor_soam_ptr] ld h, a @@ -63,6 +87,11 @@ actors_update: push de push bc + ; store current actor in act + ld a, d + dec a ; -1 to get 0-index counter + ld [act], a + ld hl, actor_update_table ld a, [bc] call call_tbl diff --git a/src/wram.s b/src/wram.s index c4037e9..e4a8119 100644 --- a/src/wram.s +++ b/src/wram.s @@ -155,6 +155,9 @@ who: .adv 1 ; give control to the next actor end_turn: .adv 1 + ; current actor that is being updated +act: .adv 1 + #define ANIM_MOVE_TILE_SIZE 16 #define ANIM_STEP_DOWN 1 #define ANIM_STEP_LEFT 0xFF -- 2.30.2