For the past 2 months, I have been struggling to add even more music into my sonic 2 hack, Sonic Loco 2. I need this featuer implemented into my hack before I submit it into the hacking contest. I plan on using different songs per boss (like in Megamix), and having a music monitor like in S1Nineko for a hidden song per zone. These new songs will total more than the original limit of Sonic 2 of $1F songs.
Below is the code for my attempt of adding more than $1F songs. FYI, I am using the Sonic 2 clone driver, which is based upon the simpler Sonic 1 Sound driver, and one of the latest .svn disasms for Sonic 2. What am I doing wrong, and could anybody help me fix it?
s2.constants.asm:
After I tried to compile that, I got errors such as "zMusIDPtr_EHZH, symbol undefined". So, after more searching, in the s2.sounddriver.asm, I changed this:
Even after this, some symbols were still "undefined". After more searching, I changed this in s2.asm:
Even after that, I got a new error:
"> > >s2.asm(88541): error: soundBank must fit in $8000 bytes but was $8012. Try moving something to the other bank.
> > > fatal "soundBank must fit in $8000 bytes but was $\{*-soundBankStart}. Try moving something to the other bank."
fatal error, assembly terminated"
As suggested in the Q&A thread, I commented out this fatal error to see what would happen. What happened was that the new songs were inserted, BUT any of the old songs that were shifted past sound test ID $1F were omitted! Any value >=$20 in the sound test was still sfx. How can I add more songs? I believe that the game still thinks that the music is banked, even though the S1Snd driver was ported...
Below are some useful resources, including my hack disasm, which you can use to try to fix the problem. It isn't the latest version of my disasm, so you will need to give me steps to implement the fix into the latest version of my hack. Also below is my OST, complete with the new songs (boss songs and hidden songs) for testing.
S2 z80 sound driver info (if you want to fix this problem in z80)
lMy hack disasm for testing purposes (password is "Loco")
Sonic 2 Loco OST
Below is the code for my attempt of adding more than $1F songs. FYI, I am using the Sonic 2 clone driver, which is based upon the simpler Sonic 1 Sound driver, and one of the latest .svn disasms for Sonic 2. What am I doing wrong, and could anybody help me fix it?
s2.constants.asm:
Syntax Highlighted Code: ASM
; Music IDs
offset := zMasterPlaylist
ptrsize := 1
idstart := $68
; $80 is reserved for silence, so if you make idstart $80 or less,
; you may need to insert a dummy zMusIDPtr in the $80 slot
MusID__First = idstart
MUsID_EHZH = id(zMusIDPtr_EHZH) ; 68** "H" stands for "hidden"
MUsID_CPZH = id(zMusIDPtr_CPZH) ; 69
MUsID_ARZH = id(zMusIDPtr_ARZH) ; 70
MUsID_CNZH = id(zMusIDPtr_CNZH) ; 71
MUsID_HTZH = id(zMusIDPtr_HTZH) ; 72
MusID_MCZH = id(zMusIDPtr_MCZH) ; 73
MusID_OOZH = id(zMusIDPtr_OOZH) ; 74
MusID_MTZH = id(zMusIDPtr_MTZH) ; 75
MusID_Boss1 = id(zMusIDPtr_Boss1) ; 76
MusID_Boss2 = id(zMusIDPtr_Boss2) ; 77
MusID_Boss3 = id(zMusIDPtr_Boss3) ; 78
MusID_Boss4 = id(zMusIDPtr_Boss4) ; 79
MusID_Boss5 = id(zMusIDPtr_Boss5) ; 7a
MusID_Boss6 = id(zMusIDPtr_Boss6) ; 7b
MusID_Boss7 = id(zMusIDPtr_Boss7) ; 7c
MusID_Boss8 = id(zMusIDPtr_Boss8) ; 7d
MusID_Boss9 = id(zMusIDPtr_Boss9) ; 7e
MusID_Boss10 = id(zMusIDPtr_Boss10) ; 7f
MusID_Dum = id(zMusIDPtr_Dum) ; 80
MusID_2PResult = id(zMusIDPtr_2PResult) ; 81
MusID_EHZ = id(zMusIDPtr_EHZ) ; 82
MusID_MCZ_2P = id(zMusIDPtr_MCZ_2P) ; 83
MusID_OOZ = id(zMusIDPtr_OOZ) ; 84
MusID_MTZ = id(zMusIDPtr_MTZ) ; 85
MusID_HTZ = id(zMusIDPtr_HTZ) ; 86
MusID_ARZ = id(zMusIDPtr_ARZ) ; 87
MusID_CNZ_2P = id(zMusIDPtr_CNZ_2P) ; 88
MusID_CNZ = id(zMusIDPtr_CNZ) ; 89
MusID_DEZ = id(zMusIDPtr_DEZ) ; 8A
MusID_MCZ = id(zMusIDPtr_MCZ) ; 8B
MusID_EHZ_2P = id(zMusIDPtr_EHZ_2P) ; 8C
MusID_SCZ = id(zMusIDPtr_SCZ) ; 8D
MusID_CPZ = id(zMusIDPtr_CPZ) ; 8E
MusID_WFZ = id(zMusIDPtr_WFZ) ; 8F
MusID_HPZ = id(zMusIDPtr_HPZ) ; 90
MusID_Options = id(zMusIDPtr_Options) ; 91
MusID_SpecStage = id(zMusIDPtr_SpecStage) ; 92
MusID_Boss = id(zMusIDPtr_Boss) ; 93
MusID_EndBoss = id(zMusIDPtr_EndBoss) ; 94
MusID_Ending = id(zMusIDPtr_Ending) ; 95
MusID_SuperSonic = id(zMusIDPtr_SuperSonic); 96
MusID_Invincible = id(zMusIDPtr_Invincible); 97
MusID_ExtraLife = id(zMusIDPtr_ExtraLife) ; 98
MusID_Title = id(zMusIDPtr_Title) ; 99
MusID_EndLevel = id(zMusIDPtr_EndLevel) ; 9A
MusID_GameOver = id(zMusIDPtr_GameOver) ; 9B
MusID_Continue = id(zMusIDPtr_Continue) ; 9C
MusID_Emerald = id(zMusIDPtr_Emerald) ; 9D
MusID_Credits = id(zMusIDPtr_Credits) ; 9E
MusID_Countdown = id(zMusIDPtr_Countdown) ; 9F
MusID__End = id(zMusIDPtr__End) ; a0
After I tried to compile that, I got errors such as "zMusIDPtr_EHZH, symbol undefined". So, after more searching, in the s2.sounddriver.asm, I changed this:
Syntax Highlighted Code: ASM
; Music IDs
offset := MusicPoint2
ptrsize := 2
idstart := 68h ;Is this correct?
; note: +20h means uncompressed, here
ZMusIDPtr_EHZH: db id(MusPtr_EHZH) ;??
ZMusIDPtr_cPZH: db id(MusPtr_CPZH) ;??
ZMusIDPtr_ARZH: db id(MusPtr_ARZH) ;??
ZMusIDPtr_CNZH: db id(MusPtr_CNZH) ;??
ZMusIDPtr_HTZH: db id(MusPtr_HTZH) ;
ZMusIDPtr_MCZH: db id(MusPtr_MCZH) ;
ZMusIDPtr_OOZH: db id(MusPtr_OOZH) ;
ZMusIDPtr_MTZH: db id(MusPtr_MTZH) ;
ZMusIDPtr_Boss1: db id(MusPtr_Boss1) ;
ZMusIDPtr_Boss2: db id(MusPtr_Boss2) ;
ZMusIDPtr_Boss3: db id(MusPtr_Boss3) ;
ZMusIDPtr_Boss4: db id(MusPtr_Boss4) ;
ZMusIDPtr_Boss5: db id(MusPtr_Boss5) ;
ZMusIDPtr_Boss6: db id(MusPtr_Boss6) ;
ZMusIDPtr_Boss7: db id(MusPtr_Boss7) ;
ZMusIDPtr_Boss8: db id(MusPtr_Boss8) ;
ZMusIDPtr_Boss9: db id(MusPtr_Boss9) ;
ZMusIDPtr_Boss10: db id(MusPtr_Boss10) ;
ZMusIDPtr_Dum: db id(MusPtr_Dum) ;
;WTF is with these psuedo-random music IDs??
zMusIDPtr_2PResult: db id(MusPtr_2PResult) ; 92
zMusIDPtr_EHZ: db id(MusPtr_EHZ) ; 81
zMusIDPtr_MCZ_2P: db id(MusPtr_MCZ_2P) ; 85
zMusIDPtr_OOZ: db id(MusPtr_OOZ) ; 8F
zMusIDPtr_MTZ: db id(MusPtr_MTZ) ; 82
zMusIDPtr_HTZ: db id(MusPtr_HTZ) ; 94
zMusIDPtr_ARZ: db id(MusPtr_ARZ) ; 86
zMusIDPtr_CNZ_2P: db id(MusPtr_CNZ_2P) ; 80
zMusIDPtr_CNZ: db id(MusPtr_CNZ) ; 83
zMusIDPtr_DEZ: db id(MusPtr_DEZ) ; 87
zMusIDPtr_MCZ: db id(MusPtr_MCZ) ; 84
zMusIDPtr_EHZ_2P: db id(MusPtr_EHZ_2P) ; 91
zMusIDPtr_SCZ: db id(MusPtr_SCZ) ; 8E
zMusIDPtr_CPZ: db id(MusPtr_CPZ) ; 8C
zMusIDPtr_WFZ: db id(MusPtr_WFZ) ; 90
zMusIDPtr_HPZ: db id(MusPtr_HPZ) ; 9B
zMusIDPtr_Options: db id(MusPtr_Options) ; 89
zMusIDPtr_SpecStage: db id(MusPtr_SpecStage) ; 88
zMusIDPtr_Boss: db id(MusPtr_Boss) ; 8D
zMusIDPtr_EndBoss: db id(MusPtr_EndBoss) ; 8B
zMusIDPtr_Ending: db id(MusPtr_Ending) ; 8A
zMusIDPtr_SuperSonic: db id(MusPtr_SuperSonic) ; 93
zMusIDPtr_Invincible: db id(MusPtr_Invincible) ; 99
zMusIDPtr_ExtraLife: db id(MusPtr_ExtraLife)+20h; B5
zMusIDPtr_Title: db id(MusPtr_Title) ; 96
zMusIDPtr_EndLevel: db id(MusPtr_EndLevel) ; 97
zMusIDPtr_GameOver: db id(MusPtr_GameOver)+20h ; B8
zMusIDPtr_Continue: db (MusPtr_Continue-MusicPoint1)/ptrsize ; 0
zMusIDPtr_Emerald: db id(MusPtr_Emerald)+20h ; BA
zMusIDPtr_Credits: db id(MusPtr_Credits)+20h ; BD
zMusIDPtr_Countdown: db id(MusPtr_Drowning)+40h ; DC
zMusIDPtr__End:
Even after this, some symbols were still "undefined". After more searching, I changed this in s2.asm:
Syntax Highlighted Code: ASM
; ------------------------------------------------------------------------------
; Music pointers
; ------------------------------------------------------------------------------
align $8000
soundBankStart := *
; loc_F8000:
MusicPoint2:
;**
MusPtr_EHZH: rom_ptr_z80 Mus_EHZH
MusPtr_CPZH: rom_ptr_z80 Mus_CPZH
MusPtr_ARZH: rom_ptr_z80 Mus_ARZH
MusPtr_CNZH: rom_ptr_z80 Mus_CNZH
MusPtr_HTZH: rom_ptr_z80 Mus_HTZH
MusPtr_MCZH: rom_ptr_z80 Mus_MCZH
MusPtr_OOZH: rom_ptr_z80 Mus_OOZH
MusPtr_MTZH: rom_ptr_z80 Mus_MTZH
MusPtr_Boss1: rom_ptr_z80 Mus_Boss1
MusPtr_Boss2: rom_ptr_z80 Mus_Boss2
MusPtr_Boss3: rom_ptr_z80 Mus_Boss3
MusPtr_Boss4: rom_ptr_z80 Mus_Boss4
MusPtr_Boss5: rom_ptr_z80 Mus_Boss5
MusPtr_Boss6: rom_ptr_z80 Mus_Boss6
MusPtr_Boss7: rom_ptr_z80 Mus_Boss7
MusPtr_Boss8: rom_ptr_z80 Mus_Boss8
MusPtr_Boss9: rom_ptr_z80 Mus_Boss9
MusPtr_Boss10: rom_ptr_z80 Mus_Boss10
MusPtr_Dum: rom_ptr_z80 Mus_Dum
MusPtr_CNZ_2P: rom_ptr_z80 Mus_CNZ_2P
MusPtr_EHZ: rom_ptr_z80 Mus_EHZ
MusPtr_MTZ: rom_ptr_z80 Mus_MTZ
MusPtr_CNZ: rom_ptr_z80 Mus_CNZ
MusPtr_MCZ: rom_ptr_z80 Mus_MCZ
MusPtr_MCZ_2P: rom_ptr_z80 Mus_MCZ_2P
MusPtr_ARZ: rom_ptr_z80 Mus_ARZ
MusPtr_DEZ: rom_ptr_z80 Mus_DEZ
MusPtr_SpecStage: rom_ptr_z80 Mus_SpecStage
MusPtr_Options: rom_ptr_z80 Mus_Options
MusPtr_Ending: rom_ptr_z80 Mus_Ending
MusPtr_EndBoss: rom_ptr_z80 Mus_EndBoss
MusPtr_CPZ: rom_ptr_z80 Mus_CPZ
MusPtr_Boss: rom_ptr_z80 Mus_Boss
MusPtr_SCZ: rom_ptr_z80 Mus_SCZ
MusPtr_OOZ: rom_ptr_z80 Mus_OOZ
MusPtr_WFZ: rom_ptr_z80 Mus_WFZ
MusPtr_EHZ_2P: rom_ptr_z80 Mus_EHZ_2P
MusPtr_2PResult: rom_ptr_z80 Mus_2PResult
MusPtr_SuperSonic: rom_ptr_z80 Mus_SuperSonic
MusPtr_HTZ: rom_ptr_z80 Mus_HTZ
MusPtr_ExtraLife: rom_ptr_z80 Mus_ExtraLife
MusPtr_Title: rom_ptr_z80 Mus_Title
MusPtr_EndLevel: rom_ptr_z80 Mus_EndLevel
MusPtr_GameOver: rom_ptr_z80 Mus_GameOver
MusPtr_Invincible: rom_ptr_z80 Mus_Invincible
MusPtr_Emerald: rom_ptr_z80 Mus_Emerald
MusPtr_HPZ: rom_ptr_z80 Mus_HPZ
MusPtr_Drowning: rom_ptr_z80 Mus_Drowning
MusPtr_Credits: rom_ptr_z80 Mus_Credits
Even after that, I got a new error:
"> > >s2.asm(88541): error: soundBank must fit in $8000 bytes but was $8012. Try moving something to the other bank.
> > > fatal "soundBank must fit in $8000 bytes but was $\{*-soundBankStart}. Try moving something to the other bank."
fatal error, assembly terminated"
As suggested in the Q&A thread, I commented out this fatal error to see what would happen. What happened was that the new songs were inserted, BUT any of the old songs that were shifted past sound test ID $1F were omitted! Any value >=$20 in the sound test was still sfx. How can I add more songs? I believe that the game still thinks that the music is banked, even though the S1Snd driver was ported...
Below are some useful resources, including my hack disasm, which you can use to try to fix the problem. It isn't the latest version of my disasm, so you will need to give me steps to implement the fix into the latest version of my hack. Also below is my OST, complete with the new songs (boss songs and hidden songs) for testing.
S2 z80 sound driver info (if you want to fix this problem in z80)
lMy hack disasm for testing purposes (password is "Loco")
Sonic 2 Loco OST
This post has been edited by Tamkis: 27 June 2011 - 04:53 PM


00
