shithub: pokecrystal

Download patch

ref: 4b4c53c7ae7f61499304c69b60e39406c5d47126
parent: e025ab9db0b85cadb42e9b72ac408a58f8133672
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sun Dec 9 12:56:13 EST 2018

Format music macros like movement macros

--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -1138,7 +1138,7 @@
 	call GetMusicByte ; store next byte in a
 	cp endchannel_cmd
 	jr z, .endchannel
-	cp first_music_cmd
+	cp FIRST_MUSIC_CMD
 	jr c, .readnote
 	; then it's a command
 .readcommand
@@ -1350,7 +1350,7 @@
 	; reload command
 	ld a, [wCurMusicByte]
 	; get command #
-	sub first_music_cmd
+	sub FIRST_MUSIC_CMD
 	ld e, a
 	ld d, 0
 	; seek command pointer
--- a/macros/scripts/audio.asm
+++ b/macros/scripts/audio.asm
@@ -20,20 +20,23 @@
 ENDM
 
 ; MusicCommands indexes (see audio/engine.asm)
-	enum_start $d8
-first_music_cmd EQU __enum__ + -8
+	enum_start $d0, +8
+FIRST_MUSIC_CMD EQU __enum__
 
+	enum octave_cmd ; $d0
 octave: MACRO
-	db first_music_cmd + 8 - (\1)
+	db octave_cmd | 8 - (\1)
 ENDM
 
+__enumdir__ = +1
+
 	enum notetype_cmd ; $d8
 notetype: MACRO
 	db notetype_cmd
 	db \1 ; note_length
-	if _NARG >= 2
+if _NARG >= 2
 	db \2 ; intensity
-	endc
+endc
 ENDM
 
 	enum pitchoffset_cmd ; $d9