Difference between revisions of "Expand the music index from $94 to $9F"
From Sonic Retro
m |
(Added info on extending the music index and pointers plus a "bug fix" for song 9F which normally won't play with the original tutorial.) |
||
Line 14: | Line 14: | ||
And now the sound test will have the music slots going up to $9F, instead of $94, however attempts to play empty music slots will crash the sound driver, and possibly lock up the emulator. So, make sure you include a song in every slot. | And now the sound test will have the music slots going up to $9F, instead of $94, however attempts to play empty music slots will crash the sound driver, and possibly lock up the emulator. So, make sure you include a song in every slot. | ||
+ | |||
+ | ''(Addition by [[User:Vanya|Vanya]])'' | ||
+ | |||
+ | This applies to the Hivebrain 2005 disasm. | ||
+ | Just adding the new .bin files to the sound folder isn't enough. You'll need to add entries to the music index and the music pointers. | ||
+ | |||
+ | First, search for "<b>MusicIndex:</b>" and following the same format add new entries for the new tracks. | ||
+ | |||
+ | <asm> | ||
+ | MusicIndex: dc.l Music81, Music82 | ||
+ | dc.l Music83, Music84 | ||
+ | dc.l Music85, Music86 | ||
+ | dc.l Music87, Music88 | ||
+ | dc.l Music89, Music8A | ||
+ | dc.l Music8B, Music8C | ||
+ | dc.l Music8D, Music8E | ||
+ | dc.l Music8F, Music90 | ||
+ | dc.l Music91, Music92 | ||
+ | dc.l Music93 | ||
+ | </asm> | ||
+ | |||
+ | You should end up with this: | ||
+ | |||
+ | <asm> | ||
+ | MusicIndex: dc.l Music81, Music82 | ||
+ | dc.l Music83, Music84 | ||
+ | dc.l Music85, Music86 | ||
+ | dc.l Music87, Music88 | ||
+ | dc.l Music89, Music8A | ||
+ | dc.l Music8B, Music8C | ||
+ | dc.l Music8D, Music8E | ||
+ | dc.l Music8F, Music90 | ||
+ | dc.l Music91, Music92 | ||
+ | dc.l Music93, Music94 | ||
+ | dc.l Music95, Music96 | ||
+ | dc.l Music97, Music98 | ||
+ | dc.l Music99, Music9A | ||
+ | dc.l Music9B, Music9C | ||
+ | dc.l Music9D, Music9E | ||
+ | dc.l Music9F | ||
+ | </asm> | ||
+ | |||
+ | Next, expand the music file pointers. They are at the end of the file just before the sound effect pointers. | ||
+ | Just add entries for the remaining files at the end. | ||
+ | |||
+ | <asm> | ||
+ | Music94: incbin sound\music94.bin | ||
+ | even | ||
+ | Music95: incbin sound\music95.bin | ||
+ | even | ||
+ | Music96: incbin sound\music96.bin | ||
+ | even | ||
+ | Music97: incbin sound\music97.bin | ||
+ | even | ||
+ | Music98: incbin sound\music98.bin | ||
+ | even | ||
+ | Music99: incbin sound\music99.bin | ||
+ | even | ||
+ | Music9A: incbin sound\music9A.bin | ||
+ | even | ||
+ | Music9B: incbin sound\music9B.bin | ||
+ | even | ||
+ | Music9C: incbin sound\music9C.bin | ||
+ | even | ||
+ | Music9D: incbin sound\music9D.bin | ||
+ | even | ||
+ | Music9E: incbin sound\music9E.bin | ||
+ | even | ||
+ | Music9F: incbin sound\music9F.bin | ||
+ | even | ||
+ | </asm> | ||
+ | |||
+ | One last thing to note is that song 9F won't play unless one more change is made. | ||
+ | |||
+ | <asm>LevSel_NoCheat: | ||
+ | cmpi.w #$94,d0 ; is sound $80-$94 being played? | ||
+ | bcs.s LevSel_PlaySnd; if yes, branch | ||
+ | cmpi.w #$A0,d0 ; is sound $95-$A0 being played? | ||
+ | bcs.s LevelSelect; if yes, branch</asm> | ||
+ | Change the line: | ||
+ | <asm> bcs.s LevSel_PlaySnd; if yes, branch</asm> | ||
+ | So it reads: | ||
+ | <asm> ble.s LevSel_PlaySnd; if yes, branch</asm> | ||
{{S1Howtos}} | {{S1Howtos}} | ||
[[Category:SCHG_How-tos|{{PAGENAME}}]] | [[Category:SCHG_How-tos|{{PAGENAME}}]] |
Revision as of 12:53, 19 October 2014
(Original guide by lukeusher123)
To add more music slots to the sound test, search for this code in the level select routine: <asm>LevSel_NoCheat:
cmpi.w #$94,d0 ; is sound $80-$94 being played? bcs.s LevSel_PlaySnd; if yes, branch cmpi.w #$A0,d0 ; is sound $95-$A0 being played? bcs.s LevelSelect; if yes, branch</asm>
Change the line: <asm> cmpi.w #$94,d0 ; is sound $80-$94 being played?</asm> So it reads: <asm> cmpi.w #$9F,d0 ; is sound $80-$9F being played?</asm> Then rebuild the ROM.
And now the sound test will have the music slots going up to $9F, instead of $94, however attempts to play empty music slots will crash the sound driver, and possibly lock up the emulator. So, make sure you include a song in every slot.
(Addition by Vanya)
This applies to the Hivebrain 2005 disasm. Just adding the new .bin files to the sound folder isn't enough. You'll need to add entries to the music index and the music pointers.
First, search for "MusicIndex:" and following the same format add new entries for the new tracks.
<asm> MusicIndex: dc.l Music81, Music82 dc.l Music83, Music84 dc.l Music85, Music86 dc.l Music87, Music88 dc.l Music89, Music8A dc.l Music8B, Music8C dc.l Music8D, Music8E dc.l Music8F, Music90 dc.l Music91, Music92 dc.l Music93 </asm>
You should end up with this:
<asm> MusicIndex: dc.l Music81, Music82 dc.l Music83, Music84 dc.l Music85, Music86 dc.l Music87, Music88 dc.l Music89, Music8A dc.l Music8B, Music8C dc.l Music8D, Music8E dc.l Music8F, Music90 dc.l Music91, Music92 dc.l Music93, Music94 dc.l Music95, Music96 dc.l Music97, Music98 dc.l Music99, Music9A dc.l Music9B, Music9C dc.l Music9D, Music9E dc.l Music9F </asm>
Next, expand the music file pointers. They are at the end of the file just before the sound effect pointers. Just add entries for the remaining files at the end.
<asm> Music94: incbin sound\music94.bin even Music95: incbin sound\music95.bin even Music96: incbin sound\music96.bin even Music97: incbin sound\music97.bin even Music98: incbin sound\music98.bin even Music99: incbin sound\music99.bin even Music9A: incbin sound\music9A.bin even Music9B: incbin sound\music9B.bin even Music9C: incbin sound\music9C.bin even Music9D: incbin sound\music9D.bin even Music9E: incbin sound\music9E.bin even Music9F: incbin sound\music9F.bin even </asm>
One last thing to note is that song 9F won't play unless one more change is made.
<asm>LevSel_NoCheat:
cmpi.w #$94,d0 ; is sound $80-$94 being played? bcs.s LevSel_PlaySnd; if yes, branch cmpi.w #$A0,d0 ; is sound $95-$A0 being played? bcs.s LevelSelect; if yes, branch</asm>
Change the line: <asm> bcs.s LevSel_PlaySnd; if yes, branch</asm> So it reads: <asm> ble.s LevSel_PlaySnd; if yes, branch</asm>