Sonic and Sega Retro Message Board: How to extend Music Slots in Sonic 1 - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 

How to extend Music Slots in Sonic 1

#1 User is offline Mikel 

Posted 06 October 2008 - 05:52 PM

  • Posts: 489
  • Joined: 21-December 03
  • Gender:Male
  • Location:Oklahoma
  • Project:An unnamed hack of Sonic 1
  • Wiki edits:2,699
Well, you remember the guide I posted in GasparXR's help topic, right?

I'm going to post a modified version of my music extending guide here.

To start go to Sound_ChkValue, if you see this line:

Syntax Highlighted Code: ASM
		[color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]E4[/color],d7
[color= #00bfff;]bls[/color].[color= #00bfff;]s[/color] Sound_E0toE4

Add this under Sound_E0toE4:

Syntax Highlighted Code: ASM
		[color= #00bfff;]cmpi[/color].[color= #00bfff;]b[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]FF[/color],d7
[color= #00bfff;]bls[/color].[color= #00bfff;]w[/color] Sound_E5toFF

Then, go to Sound_81to9F, and add this above Sound_81to9F:

Syntax Highlighted Code: ASM
Sound_E5toFF:
[color= #00bfff;]jsr[/color] sub_725CA(pc)
[color= #00bfff;]movea[/color].[color= #00bfff;]l[/color] (off_719A0).[color= #00bfff;]l[/color],a4
[color= #00bfff;]subi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]E5[/color],d7
[color= #00bfff;]move[/color].[color= #00bfff;]b[/color] (a4,d7.[color= #00bfff;]w[/color]),[color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]29[/color][/color](a6)
[color= #00bfff;]movea[/color].[color= #00bfff;]l[/color] (Go_MusicIndex_E5toFF).[color= #00bfff;]l[/color],a4
[color= #00bfff;]jmp[/color] Music_Continue

Then go to loc_7202C, and change it to:

Syntax Highlighted Code: ASM
 
loc_7202C:
[color= #00bfff;]jsr[/color] sub_725CA(pc)
[color= #00bfff;]movea[/color].[color= #00bfff;]l[/color] (off_719A0).[color= #00bfff;]l[/color],a4
[color= #00bfff;]subi[/color].[color= #00bfff;]b[/color] [color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]81[/color][/color],d7
[color= #00bfff;]move[/color].[color= #00bfff;]b[/color] (a4,d7.[color= #00bfff;]w[/color]),[color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]29[/color][/color](a6)
[color= #00bfff;]movea[/color].[color= #00bfff;]l[/color] (Go_MusicIndex).[color= #00bfff;]l[/color],a4
Music_Continue:
[color= #00bfff;]lsl[/color].[color= #00bfff;]w[/color] [color= #ff0000;]#[/color][color= #ff0000;]2[/color],d7
[color= #00bfff;]movea[/color].[color= #00bfff;]l[/color] (a4,d7.[color= #00bfff;]w[/color]),a4
[color= #00bfff;]moveq[/color] [color= #ff0000;]#[/color][color= #ff0000;]0[/color],d0
[color= #00bfff;]move[/color].[color= #00bfff;]w[/color] (a4),d0
[color= #00bfff;]add[/color].[color= #00bfff;]l[/color] a4,d0
[color= #00bfff;]move[/color].[color= #00bfff;]l[/color] d0,[color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]18[/color][/color](a6)
[color= #00bfff;]move[/color].[color= #00bfff;]b[/color] [color= #ff0000;]5[/color](a4),d0
[color= #00bfff;]move[/color].[color= #00bfff;]b[/color] d0,[color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]28[/color][/color](a6)
[color= #00bfff;]tst[/color].[color= #00bfff;]b[/color] [color= #ff0000;]$[/color][color= #ff0000;]2A[/color](a6)
[color= #00bfff;]beq[/color].[color= #00bfff;]s[/color] loc_72068
[color= #00bfff;]move[/color].[color= #00bfff;]b[/color] [color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]29[/color][/color](a6),d0

Then, change:

Syntax Highlighted Code: ASM
 
Go_SoundTypes: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] SoundTypes [color= #adadad; font-style: italic;]; XREF: Sound_Play[/color]
Go_SoundD0: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] SoundD0Index [color= #adadad; font-style: italic;]; XREF: Sound_D0toDF[/color]
Go_MusicIndex: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicIndex [color= #adadad; font-style: italic;]; XREF: Sound_81to9F[/color]
Go_SoundIndex: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] SoundIndex [color= #adadad; font-style: italic;]; XREF: Sound_A0toCF[/color]
off_719A0: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] byte_71A94 [color= #adadad; font-style: italic;]; XREF: Sound_81to9F[/color]
Go_PSGIndex: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] PSG_Index [color= #adadad; font-style: italic;]; XREF: sub_72926[/color]

To:

Syntax Highlighted Code: ASM
		[color= #00CC66;]align[/color] [color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]10[/color][/color]
Go_SoundTypes: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] SoundTypes [color= #adadad; font-style: italic;]; XREF: Sound_Play[/color]
Go_SoundD0: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] SoundD0Index [color= #adadad; font-style: italic;]; XREF: Sound_D0toDF[/color]
Go_MusicIndex: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicIndex [color= #adadad; font-style: italic;]; XREF: Sound_81to9F[/color]
Go_MusicIndex_E5toFF: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicIndex_E5plus [color= #adadad; font-style: italic;]; XREF: Sound_81to9F[/color]
Go_SoundIndex: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] SoundIndex [color= #adadad; font-style: italic;]; XREF: Sound_A0toCF[/color]
off_719A0: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] byte_71A94 [color= #adadad; font-style: italic;]; XREF: Sound_81to9F[/color]
Go_PSGIndex: [color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] PSG_Index [color= #adadad; font-style: italic;]; XREF: sub_72926[/color]

Then, go to:

Syntax Highlighted Code: ASM
Music9F:	[color= #00bfff;]incbin[/color]	soundmusic9F.bin
[color= #00CC66;]even[/color]

And add the following lines under the line I posted above:

Syntax Highlighted Code: ASM
MusicIndex_E5plus:	
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicE5, MusicE6
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicE7, MusicE8
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicE9, MusicEA
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicEB, MusicEC
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicED, MusicEE
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicEF, MusicF0
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicF1, MusicF2
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicF3, MusicF4
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicF5, MusicF6
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicF7, MusicF8
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicF9, MusicFA
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicFB, MusicFC
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicFD, MusicFE
[color= #00bfff;]dc[/color].[color= #00bfff;]l[/color] MusicFF


Then, under MusicIndex_E5toFF, add these lines:

Syntax Highlighted Code: ASM
MusicE5:	[color= #00bfff;]incbin[/color]	soundmusicE5.bin
[color= #00CC66;]even[/color]
MusicE6: [color= #00bfff;]incbin[/color] soundmusicE6.bin
[color= #00CC66;]even[/color]
MusicE7: [color= #00bfff;]incbin[/color] soundmusicE7.bin
[color= #00CC66;]even[/color]
MusicE8: [color= #00bfff;]incbin[/color] soundmusicE8.bin
[color= #00CC66;]even[/color]
MusicE9: [color= #00bfff;]incbin[/color] soundmusicE9.bin
[color= #00CC66;]even[/color]
MusicEA: [color= #00bfff;]incbin[/color] soundmusicEA.bin
[color= #00CC66;]even[/color]
MusicEB: [color= #00bfff;]incbin[/color] soundmusicEB.bin
[color= #00CC66;]even[/color]
MusicEC: [color= #00bfff;]incbin[/color] soundmusicEC.bin
[color= #00CC66;]even[/color]
MusicED: [color= #00bfff;]incbin[/color] soundmusicED.bin
[color= #00CC66;]even[/color]
MusicEE: [color= #00bfff;]incbin[/color] soundmusicEE.bin
[color= #00CC66;]even[/color]
MusicEF: [color= #00bfff;]incbin[/color] soundmusicEF.bin
[color= #00CC66;]even[/color]
MusicF0: [color= #00bfff;]incbin[/color] soundmusicF0.bin
[color= #00CC66;]even[/color]
MusicF1: [color= #00bfff;]incbin[/color] soundmusicF1.bin
[color= #00CC66;]even[/color]
MusicF2: [color= #00bfff;]incbin[/color] soundmusicF2.bin
[color= #00CC66;]even[/color]
MusicF3: [color= #00bfff;]incbin[/color] soundmusicF3.bin
[color= #00CC66;]even[/color]
MusicF4: [color= #00bfff;]incbin[/color] soundmusicF4.bin
[color= #00CC66;]even[/color]
MusicF5: [color= #00bfff;]incbin[/color] soundmusicF5.bin
[color= #00CC66;]even[/color]
MusicF6: [color= #00bfff;]incbin[/color] soundmusicF6.bin
[color= #00CC66;]even[/color]
MusicF7: [color= #00bfff;]incbin[/color] soundmusicF7.bin
[color= #00CC66;]even[/color]
MusicF8: [color= #00bfff;]incbin[/color] soundmusicF8.bin
[color= #00CC66;]even[/color]
MusicF9: [color= #00bfff;]incbin[/color] soundmusicF9.bin
[color= #00CC66;]even[/color]
MusicFA: [color= #00bfff;]incbin[/color] soundmusicFA.bin
[color= #00CC66;]even[/color]
MusicFB: [color= #00bfff;]incbin[/color] soundmusicFB.bin
[color= #00CC66;]even[/color]
MusicFC: [color= #00bfff;]incbin[/color] soundmusicFC.bin
[color= #00CC66;]even[/color]
MusicFD: [color= #00bfff;]incbin[/color] soundmusicFD.bin
[color= #00CC66;]even[/color]
MusicFE: [color= #00bfff;]incbin[/color] soundmusicFE.bin
[color= #00CC66;]even[/color]
MusicFF: [color= #00bfff;]incbin[/color] soundmusicFF.bin
[color= #00CC66;]even[/color]

Next, we are going to extend the slots in the Sound Test, first go to LevSel_SndTest, and change:

Syntax Highlighted Code: ASM
		[color= #00bfff;]moveq[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]4F[/color],d0		[color= #adadad; font-style: italic;]; if sound test	moves below 0, set to $4F[/color]

To:

Syntax Highlighted Code: ASM
		[color= #00bfff;]moveq[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]7F[/color],d0		[color= #adadad; font-style: italic;]; if sound test	moves below 0, set to $7F[/color]

Then, go to LevSel_Right, and change:

Syntax Highlighted Code: ASM
		[color= #00bfff;]cmpi[/color].[color= #00bfff;]w[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]50[/color][/color],d0

To:

Syntax Highlighted Code: ASM
		[color= #00bfff;]cmpi[/color].[color= #00bfff;]w[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;][color= #ff0000;]80[/color][/color],d0

Last but not least, we are going to allow the Sound Test to read slots $E5 to $FF, so go to LevSel_NoCheat, and change:

Syntax Highlighted Code: ASM
		[color= #00bfff;]cmpi[/color].[color= #00bfff;]w[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]9F[/color],d0		[color= #adadad; font-style: italic;]; is sound $80-$9F being played?[/color]
[color= #00bfff;]ble[/color].[color= #00bfff;]s[/color] LevSel_PlaySnd [color= #adadad; font-style: italic;]; if yes, branch[/color]

To:

Syntax Highlighted Code: ASM
		[color= #00bfff;]cmpi[/color].[color= #00bfff;]w[/color]	[color= #ff0000;]#[/color][color= #ff0000;]$[/color][color= #ff0000;]FF[/color],d0		[color= #adadad; font-style: italic;]; is sound $E5-$FF being played?[/color]
[color= #00bfff;]ble[/color].[color= #00bfff;]s[/color] LevSel_PlaySnd [color= #adadad; font-style: italic;]; if yes, branch[/color]

Then, build the rom and check out your newly added tunes.

That's all, if you have any questions on Sound Test expansion, PM me, or post here.
This post has been edited by Mikel: 06 October 2008 - 06:07 PM

#2 User is offline PsychoSk8r 

Posted 06 October 2008 - 05:58 PM

  • HighKnights
  • Posts: 2572
  • Joined: 11-July 07
  • Gender:Male
  • Location:Walsall, UK
  • Project:30 Day Project: Revisited.A New Release!
  • Wiki edits:19
That right there is just what I need. Awesome. I very much appreciate this.
Also, Good to see you're using my generator in your sig =P

#3 User is offline Master3k 

Posted 06 October 2008 - 06:31 PM

  • Posts: 278
  • Joined: 25-July 07
  • Gender:Male
  • Wiki edits:27
Great! I see that you covered things that you didn't before (such as the Music_Continue routine which was non-existant on the older code). Might use this someday...

EDIT:Double-written a word
This post has been edited by Master3k: 06 October 2008 - 06:32 PM

#4 User is offline Spanner 

Posted 06 October 2008 - 06:37 PM

  • Mako Retro
  • Posts: 2813
  • Joined: 02-June 07
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic the Hedgehog Hacking Contest, Other Stuff
  • Wiki edits:2,193
Nice work. This definately allows plenty of other stuff that could be used such as seperate certain tunes if you've added a second character.
Maybe you could try getting 01 to FF to work, I've been trying to do that in Sonic 2 but to no avail.
This post has been edited by SOTI: 06 October 2008 - 06:37 PM

#5 User is offline Eduardo Knuckles 

Posted 13 October 2008 - 03:40 PM

  • Woooohohohooo!
  • Posts: 361
  • Joined: 07-January 07
  • Gender:Male
  • Location:You don't need to know it.
  • Project:Sonic 1 Harder Levels, Sonic Eggland
  • Wiki edits:66
Wow, now it works. Thank you so much, man
This post has been edited by Eduardo Knuckles: 13 October 2008 - 03:40 PM

#6 User is offline GasparXR 

Posted 13 October 2008 - 04:36 PM

  • I'm back!
  • Posts: 425
  • Joined: 12-April 08
  • Gender:Male
  • Location:Espanola, Ontario, Canada
  • Project:Super Mario XR
  • Wiki edits:29
I remember the one you posted in my topic didn't even work right. =P Once I get home I'm trying this, it looks good.

#7 User is offline GasparXR 

Posted 19 October 2008 - 03:37 PM

  • I'm back!
  • Posts: 425
  • Joined: 12-April 08
  • Gender:Male
  • Location:Espanola, Ontario, Canada
  • Project:Super Mario XR
  • Wiki edits:29
Double post >.< Since I don't have any tracks 95-9F or E6-FF, I only added 94 and E5 to whichever loading routine they belong to(pardon the vocabulary I'm using). Now when I loaded them in MusicIndex & MusicIndexE5plus(as well as incbinning them) 94 will play in the soundtest, but E5 won't. Ingame, If I set the speedshoes music to E5 it treats it as if it's silence; the zone music still plays. When it's supposed to return to zone music, it just restarts the zone music.

Strangely enough, it's able to build with no errors. =\ Any ideas?
This post has been edited by GasparXR: 19 October 2008 - 03:47 PM

#8 User is offline Hayate 

Posted 20 October 2008 - 03:59 AM

  • Posts: 2359
  • Joined: 01-February 04
  • Gender:Male
  • Location:Torquay, England
  • Wiki edits:70

View PostSOTI, on Oct 7 2008, 12:37 AM, said:

Nice work. This definately allows plenty of other stuff that could be used such as seperate certain tunes if you've added a second character.
Maybe you could try getting 01 to FF to work, I've been trying to do that in Sonic 2 but to no avail.


I did this for Project Nanako (for various reasons, neither 00 nor 80 can be used). I might sometime write up a topic on how to do it.

#9 User is offline roxahris 

Posted 20 October 2008 - 04:02 AM

  • Everyone's a hypocrite. Take my word for it.
  • Posts: 1221
  • Joined: 24-January 07
  • Gender:Male
  • Project:Doing anything at all
  • Wiki edits:30
Please, please do, it would be awesome...

#10 User is offline Spanner 

Posted 20 October 2008 - 11:00 AM

  • Mako Retro
  • Posts: 2813
  • Joined: 02-June 07
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic the Hedgehog Hacking Contest, Other Stuff
  • Wiki edits:2,193
Sorry, I meant 7F not FF. Just saying.

#11 User is offline roxahris 

Posted 21 October 2008 - 12:04 AM

  • Everyone's a hypocrite. Take my word for it.
  • Posts: 1221
  • Joined: 24-January 07
  • Gender:Male
  • Project:Doing anything at all
  • Wiki edits:30

View PostSOTI, on Oct 21 2008, 01:30 AM, said:

Sorry, I meant 7F not FF. Just saying.
What's the difference? :)

#12 User is offline Eduardo Knuckles 

Posted 05 November 2008 - 03:13 PM

  • Woooohohohooo!
  • Posts: 361
  • Joined: 07-January 07
  • Gender:Male
  • Location:You don't need to know it.
  • Project:Sonic 1 Harder Levels, Sonic Eggland
  • Wiki edits:66

View Postroxahris, on Oct 21 2008, 12:04 AM, said:

View PostSOTI, on Oct 21 2008, 01:30 AM, said:

Sorry, I meant 7F not FF. Just saying.
What's the difference? :)

A lot. FF is the end of music index (sure after having done the tutorial), 80 is the Begin of it...
Do not forget that we have the sound effects soon after the first songs. So, starting at E5 is being another music index.
(I think)
This post has been edited by Eduardo Knuckles: 05 November 2008 - 03:14 PM

#13 User is offline roxahris 

Posted 05 November 2008 - 03:45 PM

  • Everyone's a hypocrite. Take my word for it.
  • Posts: 1221
  • Joined: 24-January 07
  • Gender:Male
  • Project:Doing anything at all
  • Wiki edits:30
I meant in terms of making music below 80 work. I already know about 80-FF. There's just little difference between 7F and FF except FF is the absolute end of the music slots, and 7F is just the end of the ones before 80 (like 81 are the ones after 80).

Besides, I'm talking about Sonic 2, which already has music from 81-FF. Why do you think going below 80 would be needed in Sonic 1? Well, unless you needed a large amount of music and sound effects...

#14 User is offline nineko 

Posted 05 November 2008 - 03:48 PM

  • I am the Holy Cat
  • Posts: 5286
  • Joined: 17-August 06
  • Gender:Male
  • Location:italy
  • Project:I... don't even know anymore :U
  • Wiki edits:5,251

View Postroxahris, on Nov 5 2008, 09:45 PM, said:

Besides, I'm talking about Sonic 2, which already has music from 81-FF. Why do you think going below 80 would be needed in Sonic 1? Well, unless you needed a large amount of music and sound effects...
In Sonic 1, 81-9F + E5-FF gives you 58 slots, and I used them all in soniNeko. Which is why I recently edited the code to allow for 14848 song slots :D

#15 User is offline Alriightyman 

Posted 05 November 2008 - 04:14 PM

  • !!!!!!!!!!!!!!!!!
  • Posts: 345
  • Joined: 27-November 07
  • Gender:Male
  • Location:Largo, Fl
  • Project:0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
  • Wiki edits:5

View Postnineko, on Nov 5 2008, 03:48 PM, said:

In Sonic 1, 81-9F + E5-FF gives you 58 slots, and I used them all in soniNeko. Which is why I recently edited the code to allow for 14848 song slots :D

HOLY SHIT! How the hell? That's awesome! :)

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users