shithub: pokered

Download patch

ref: dbe2a3b1683caeab446ece53dce8d5e8b0fd0e07
parent: 4992ae2233d55a045e5e6803bc76972704c1a082
author: dannye <corrnondacqb@yahoo.com>
date: Wed Jul 27 16:57:46 EDT 2016

Add warnings about music/sfx macro usage
These are not game limitations, just restrictions for
the macros to behave properly

--- a/audio/headers/sfxheaders1.asm
+++ b/audio/headers/sfxheaders1.asm
@@ -280,6 +280,7 @@
 SFX_Save_1::
 	sfx SFX_Save_1, CH4_ | CH5_
 
+; the Pokeflute sound effect directly hijacks channel 2
 SFX_Pokeflute::
 	db CH2
 	dw SFX_Pokeflute_Ch2
--- a/macros.asm
+++ b/macros.asm
@@ -415,11 +415,10 @@
 CH6_ EQU 1 << CH6
 CH7_ EQU 1 << CH7
 
+; channel 0 is not optional
 music: MACRO
 	db ((((\2 & CH0_) >> CH0) + ((\2 & CH1_) >> CH1) + ((\2 & CH2_) >> CH2) + ((\2 & CH3_) >> CH3)) - 1) << 6 | CH0
-	IF \2 & CH0_
-		dw \1_Ch0
-	ENDC
+	dw \1_Ch0
 	IF \2 & CH1_
 		db CH1
 		dw \1_Ch1
@@ -434,6 +433,7 @@
 	ENDC
 ENDM
 
+; do not start a sound effect with channel 5 or 6, only channel 4 or 7
 sfx: MACRO
 	IF \2 & CH4_
 		db ((((\2 & CH4_) >> CH4) + ((\2 & CH5_) >> CH5) + ((\2 & CH6_) >> CH6) + ((\2 & CH7_) >> CH7)) - 1) << 6 | CH4