From: Lukas Krickl Date: Sun, 26 Jan 2025 06:35:57 +0000 (+0100) Subject: anim: Added struct for animations X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=b86828fb0039f494b107f061ffc06b283341e58c;p=gbrg%2F.git anim: Added struct for animations --- diff --git a/src/animation.s b/src/animation.s index 48b8368..704ba67 100644 --- a/src/animation.s +++ b/src/animation.s @@ -17,12 +17,12 @@ anim_nop: ; to set itself to 0000 when the animation is finisehd ; this is how anim_finished performs its check anim_update: - ld a, [anim_flags] + ld a, [curr_anim_flags] and a, ANIM_FREADY ret z ld hl, animation_table - ld a, [anim_update_entry] + ld a, [curr_anim_type] call call_tbl ret diff --git a/src/defs.s b/src/defs.s index 23d1672..4dfaf44 100644 --- a/src/defs.s +++ b/src/defs.s @@ -205,3 +205,8 @@ ; animation table entries .se 0 .de ANIM_TNOP, 1 + + ; anim entry struct +.se 0 +.de anim_flags, 1 +.de anim_type, 1 diff --git a/src/wram.s b/src/wram.s index 88558c0..2264b6a 100644 --- a/src/wram.s +++ b/src/wram.s @@ -99,9 +99,9 @@ anim_target_x: .adv 1 ; animation flags ; ANIM_READY is set if the animation can play -anim_flags: .adv 1 +curr_anim_flags: .adv 1 ; animation table index -anim_update_entry: .adv 2 +curr_anim_type: .adv 2 ; collision tile tmp values