From 71f047101480c7860f8011e372bb7d48b767beb0 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 13 Dec 2024 10:16:04 -0500 Subject: [PATCH] Add SetFrame and SpriteJumpTable macros --- Core/sprite_macros.asm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Core/sprite_macros.asm b/Core/sprite_macros.asm index ccd392d..ed7f62d 100644 --- a/Core/sprite_macros.asm +++ b/Core/sprite_macros.asm @@ -46,6 +46,20 @@ macro GotoAction(action) LDA.b # : STA.w SprAction, X endmacro +macro SetFrame(frame) + LDA.b # : STA.w SprFrame, X +endmacro + +macro SpriteJumpTable(...) + LDA.w SprAction, X + JSL JumpTableLocal + + !a #= 0 + while !a < sizeof(...) + dw <...[!a]> + !a #= !a+1 + endwhile +endmacro ; Increase the sprite frame every (frames_wait) frames ; reset to (frame_start) when reaching (frame_end)