shithub: pokecrystal

Download patch

ref: 60c71add580aa3aa5b096beeadd9bb83145768f6
parent: 9ab257572793d5cdcd8156ca9e1566613ab72814
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Wed Jun 10 13:15:53 EDT 2020

Define pokeanim setup commands like std scripts, predefs, and specials

No need for a macro workaround in rgbds 0.4.0

--- a/engine/gfx/pic_animation.asm
+++ b/engine/gfx/pic_animation.asm
@@ -48,14 +48,10 @@
 
 pokeanim: MACRO
 rept _NARG
-; Workaround for a bug where macro args can't come after the start of a symbol
-if !DEF(\1_POKEANIM)
-\1_POKEANIM EQUS "PokeAnim_\1_"
-endc
-	db (\1_POKEANIM - PokeAnim_SetupCommands) / 2
+	db (PokeAnim_\1_SetupCommand - PokeAnim_SetupCommands) / 2
 	shift
 endr
-	db (PokeAnim_Finish_ - PokeAnim_SetupCommands) / 2
+	db (PokeAnim_Finish_SetupCommand - PokeAnim_SetupCommands) / 2
 ENDM
 
 PokeAnims:
@@ -132,22 +128,24 @@
 	scf
 	ret
 
-PokeAnim_SetupCommands:
-setup_command: MACRO
-\1_: dw \1
+add_setup_command: MACRO
+\1_SetupCommand:
+	dw \1
 ENDM
-	setup_command PokeAnim_Finish
-	setup_command PokeAnim_BasePic
-	setup_command PokeAnim_SetWait
-	setup_command PokeAnim_Wait
-	setup_command PokeAnim_Setup
-	setup_command PokeAnim_Setup2
-	setup_command PokeAnim_Idle
-	setup_command PokeAnim_Play
-	setup_command PokeAnim_Play2
-	setup_command PokeAnim_Cry
-	setup_command PokeAnim_CryNoWait
-	setup_command PokeAnim_StereoCry
+
+PokeAnim_SetupCommands:
+	add_setup_command PokeAnim_Finish
+	add_setup_command PokeAnim_BasePic
+	add_setup_command PokeAnim_SetWait
+	add_setup_command PokeAnim_Wait
+	add_setup_command PokeAnim_Setup
+	add_setup_command PokeAnim_Setup2
+	add_setup_command PokeAnim_Idle
+	add_setup_command PokeAnim_Play
+	add_setup_command PokeAnim_Play2
+	add_setup_command PokeAnim_Cry
+	add_setup_command PokeAnim_CryNoWait
+	add_setup_command PokeAnim_StereoCry
 
 PokeAnim_SetWait:
 	ld a, 18