06-01-2012, 12:16 PM
Oh - it's pretty easy. You have to output assembly, and perhaps do a search and replace on "PAT" for a unique name.
For example, right now my never-to-be-completed footy game has multiple tunes in it:
And each assembly output from beepola has been tweaked to be unique:
Just by search and replace of "PAT" with "GrandStandPAT" to make all labels unique to this bit of code.
Player code is included separately from data, therefore.
For example, right now my never-to-be-completed footy game has multiple tunes in it:
Code:
SUB FASTCALL playTune(tune AS UBYTE)
REM gets a 0,1,2 in A and sets HL to point to relevant tune before dropping into player.
ASM
AND A
LD HL,TUNE1
JR Z,TUNESTART
DEC A
LD HL,TUNE2
JR Z,TUNESTART
LD HL,TUNE3
#include "Player.asm"
TUNE1:
#INCLUDE "Grandstand.asm"
; 400 bytes
TUNE2:
#INCLUDE "MOTD.asm"
; 489 bytes.
TUNE3:
#INCLUDE "WorldOfSport.asm"
; 102 bytes
END ASM
END SUB
And each assembly output from beepola has been tweaked to be unique:
Code:
DEFB 0 ; GrandStandPATtern loop begin * 2
DEFB 50 ; Song length * 2
DEFW 12 ; Offset to start of song (length of instrument table)
DEFB 1 ; Multiple
DEFW 0 ; Detune
DEFB 0 ; Phase
DEFB 0 ; Multiple
DEFW 6 ; Detune
DEFB 0 ; Phase
DEFB 1 ; Multiple
DEFW 12 ; Detune
DEFB 0 ; Phase
GrandStandPATTERNDATA: DEFW GrandStandPAT0
DEFW GrandStandPAT0
DEFW GrandStandPAT1
DEFW GrandStandPAT3
DEFW GrandStandPAT2
DEFW GrandStandPAT6
DEFW GrandStandPAT3
DEFW GrandStandPAT5
DEFW GrandStandPAT6
DEFW GrandStandPAT3
DEFW GrandStandPAT4
DEFW GrandStandPAT7
DEFW GrandStandPAT4
DEFW GrandStandPAT8
DEFW GrandStandPAT9
DEFW GrandStandPAT10
DEFW GrandStandPAT1
DEFW GrandStandPAT3
DEFW GrandStandPAT2
DEFW GrandStandPAT6
DEFW GrandStandPAT3
DEFW GrandStandPAT5
DEFW GrandStandPAT6
DEFW GrandStandPAT3
DEFW GrandStandPAT11
; *** GrandStandPATtern data - $00 marks the end of a GrandStandPATtern ***
GrandStandPAT0:
DEFB $BD,0
DEFB 190
DEFB 119
DEFB 190
DEFB 118
DEFB 6
DEFB $00
GrandStandPAT1:
DEFB 178
DEFB 154
DEFB 119
Just by search and replace of "PAT" with "GrandStandPAT" to make all labels unique to this bit of code.
Player code is included separately from data, therefore.