Difference between revisions of "Expand the music index to start at $00 instead of $80 (Sonic 2 Clone Driver version)"
From Sonic Retro
(Here is the Sonic 2 Clone Driver version of HPZMan's guide on How to Expand the music index to start at $00 instead of $80) |
m (Text replacement - "\[\[Category:SCHG How-tos.*" to "") |
||
(11 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | + | ''(Original guide by [[User:Mikel|Mikel]], based on a guide by [[User:HPZMan|HPZMan]])'' | |
− | + | '''Notes:''' | |
− | + | * Firstly, credit to [[User:HPZMan|HPZMan]] for the [[SCHG How-to:Expand the music index to start at $00 instead of $80|original guide]] he made for ''[[Sonic 1]]''. | |
− | + | * Secondly, you need to have the Sonic 2 Clone Driver in your hack. To get the Clone Driver, go to {{LinkRetro|topic=18930|title=this topic}}; it requires the ''Sonic 1'' Sound Driver to be [[SCHG How-to:Port Sonic 1's Sound Driver to Sonic 2|ported]] to your ''[[Sonic 2]]'' hack first. | |
First, go to "PlayMusic:" | First, go to "PlayMusic:" | ||
You will see something like this: | You will see something like this: | ||
− | < | + | <pre> |
PlayMusic: | PlayMusic: | ||
; tst.b ($FFFFFFE0).w | ; tst.b ($FFFFFFE0).w | ||
Line 18: | Line 18: | ||
move.b d0,($FFFFF00A).w | move.b d0,($FFFFF00A).w | ||
rts | rts | ||
− | </ | + | </pre> |
Change it to: | Change it to: | ||
− | < | + | <pre> |
PlayMusic: | PlayMusic: | ||
cmpi.b #$7F, d0 | cmpi.b #$7F, d0 | ||
Line 36: | Line 36: | ||
move.b d0, ($FFFFF00A) .w | move.b d0, ($FFFFF00A) .w | ||
rts | rts | ||
− | </ | + | </pre> |
Then, go to "PlaySound:". | Then, go to "PlaySound:". | ||
You will see something like this: | You will see something like this: | ||
− | < | + | <pre> |
PlaySound: | PlaySound: | ||
move.b d0,($FFFFF00B).w | move.b d0,($FFFFF00B).w | ||
rts | rts | ||
− | </ | + | </pre> |
Change it to: | Change it to: | ||
− | < | + | <pre> |
PlaySound: | PlaySound: | ||
cmpi.b #$7F, d0 | cmpi.b #$7F, d0 | ||
Line 63: | Line 63: | ||
move.b d0, ($FFFFF00B) .w | move.b d0, ($FFFFF00B) .w | ||
rts | rts | ||
− | </ | + | </pre> |
Then, go to "loc_7202C:" | Then, go to "loc_7202C:" | ||
You will see something like this: | You will see something like this: | ||
− | < | + | <pre> |
loc_7202C: | loc_7202C: | ||
jsr sub_725CA(pc) | jsr sub_725CA(pc) | ||
Line 75: | Line 75: | ||
move.b (a4,d7.w),$29(a6) | move.b (a4,d7.w),$29(a6) | ||
movea.l (Go_MusicIndex).l,a4 | movea.l (Go_MusicIndex).l,a4 | ||
− | </ | + | </pre> |
Change it to: | Change it to: | ||
− | < | + | <pre> |
loc_7202C: | loc_7202C: | ||
jsr sub_725CA (PC) | jsr sub_725CA (PC) | ||
Line 90: | Line 90: | ||
NormalIndexLoad: | NormalIndexLoad: | ||
clr.w ($FFFFFFFC) .w | clr.w ($FFFFFFFC) .w | ||
− | </ | + | </pre> |
Then, search for "Go_MusicIndex:" | Then, search for "Go_MusicIndex:" | ||
You will see something like this: | You will see something like this: | ||
− | < | + | <pre> |
Go_MusicIndex: dc.l MusicIndex ; XREF: Sound_81to9F | Go_MusicIndex: dc.l MusicIndex ; XREF: Sound_81to9F | ||
− | </ | + | </pre> |
Add this below "Go_MusicIndex:": | Add this below "Go_MusicIndex:": | ||
− | < | + | <pre> |
Go_MusicIndex_01to1F: dc.l MusicIndex_01plus | Go_MusicIndex_01to1F: dc.l MusicIndex_01plus | ||
− | </ | + | </pre> |
Then, go to "MusicIndex:" | Then, go to "MusicIndex:" | ||
You will see something like this: | You will see something like this: | ||
− | < | + | <pre> |
MusicIndex: dc.l Music81, Music82 | MusicIndex: dc.l Music81, Music82 | ||
dc.l Music83, Music84 | dc.l Music83, Music84 | ||
Line 124: | Line 124: | ||
dc.l Music9D, Music9E | dc.l Music9D, Music9E | ||
dc.l Music9F | dc.l Music9F | ||
− | </ | + | </pre> |
Then, add this below "MusicIndex:" | Then, add this below "MusicIndex:" | ||
− | < | + | <pre> |
MusicIndex_01plus: | MusicIndex_01plus: | ||
dc.l Music01, Music02 | dc.l Music01, Music02 | ||
− | </ | + | </pre> |
The "dc.l Music01, Music02" is basically an example of what music slots you should use for Slots $01 to any number you want to stop at | The "dc.l Music01, Music02" is basically an example of what music slots you should use for Slots $01 to any number you want to stop at | ||
Line 137: | Line 137: | ||
You should see something like this: | You should see something like this: | ||
− | < | + | <pre> |
Sound_ChkValue: ; XREF: sub_71B4C | Sound_ChkValue: ; XREF: sub_71B4C | ||
moveq #0,d7 | moveq #0,d7 | ||
Line 155: | Line 155: | ||
cmpi.b #$F9,d7 | cmpi.b #$F9,d7 | ||
bge.w Sound_E0toE4 | bge.w Sound_E0toE4 | ||
− | </ | + | </pre> |
Change it to: | Change it to: | ||
− | < | + | <pre> |
Sound_ChkValue: ; XREF: sub_71B4C | Sound_ChkValue: ; XREF: sub_71B4C | ||
moveq #0, d7 | moveq #0, d7 | ||
Line 180: | Line 180: | ||
cmpi.b #$F9,d7 | cmpi.b #$F9,d7 | ||
bge.w Sound_E0toE4 | bge.w Sound_E0toE4 | ||
− | </ | + | </pre> |
Now, go to "Sound_81to9F:", and change it to this: | Now, go to "Sound_81to9F:", and change it to this: | ||
− | < | + | <pre> |
Sound_ChkValueFor00: | Sound_ChkValueFor00: | ||
cmpi.b #$FF, d7; $FF = Last slot will be musics in index $00 - $7F ($FF = $7F) | cmpi.b #$FF, d7; $FF = Last slot will be musics in index $00 - $7F ($FF = $7F) | ||
Line 197: | Line 197: | ||
lea $40(a6),a5 | lea $40(a6),a5 | ||
moveq #9,d0 | moveq #9,d0 | ||
− | </ | + | </pre> |
− | Finally, we are going to Change the number of sound test slots in the options | + | Finally, we are going to Change the number of sound test slots in the options and level select menus |
+ | |||
+ | To change the Options Sound Test, | ||
Go to "word_917A:" | Go to "word_917A:" | ||
Line 204: | Line 206: | ||
You will see something like this: | You will see something like this: | ||
− | < | + | <pre> |
dc.w $7FFF ; 4 | dc.w $7FFF ; 4 | ||
dc.w Sound_test_sound ; 5 | dc.w Sound_test_sound ; 5 | ||
− | </ | + | </pre> |
Change the "$7" in "$7FFF" to anything you like, like "$FFFF", or "$CFFF" | Change the "$7" in "$7FFF" to anything you like, like "$FFFF", or "$CFFF" | ||
− | |||
− | [[ | + | |
+ | To change the Level Select Sound Test, | ||
+ | |||
+ | Go to "loc_9522:" | ||
+ | |||
+ | You will see something like this: | ||
+ | |||
+ | <pre> | ||
+ | loc_9522: | ||
+ | cmpi.w #$15,(Level_select_zone).w | ||
+ | bne.s loc_958A | ||
+ | move.w (Sound_test_sound).w,d0 | ||
+ | move.b (Ctrl_1_Press).w,d1 | ||
+ | btst #2,d1 | ||
+ | beq.s loc_953E | ||
+ | subq.b #1,d0 | ||
+ | bcc.s loc_953E | ||
+ | moveq #$7F,d0 | ||
+ | </pre> | ||
+ | On the last moveq Change the "$7" in "$7F,d0" to mach the first two letters in the value you used above, like "$FF", or "$CF". | ||
+ | |||
+ | Go to "loc_954E:" | ||
+ | |||
+ | You will see something like this: | ||
+ | |||
+ | <pre> | ||
+ | loc_954E: | ||
+ | btst #6,d1 | ||
+ | beq.s loc_955C | ||
+ | addi.b #$10,d0 | ||
+ | andi.b #$7F,d0 | ||
+ | </pre> | ||
+ | As before but on andi.b Change the "$7" in "$7F,d0" to the value you used above, like "$FF", or "$CF". | ||
+ | |||
+ | Lastly, Head back up to "loc_953E:" it should be between the two sections you just changed. | ||
+ | |||
+ | You will see something like this: | ||
+ | |||
+ | <pre> | ||
+ | loc_953E: | ||
+ | btst #3,d1 | ||
+ | beq.s loc_954E | ||
+ | addq.b #1,d0 | ||
+ | cmpi.w #$80,d0 | ||
+ | bcs.s loc_954E | ||
+ | moveq #0,d0 | ||
+ | </pre> | ||
+ | |||
+ | change it to this: | ||
+ | |||
+ | <pre> | ||
+ | loc_953E: | ||
+ | btst #3,d1 | ||
+ | beq.s loc_954E | ||
+ | addq.b #1,d0 | ||
+ | </pre> | ||
+ | |||
+ | ADDITIONAL NOTES: Level Select Sound Test code was contributed by [[User:MattATobin]] with guidance from [[User:Ayla|Ayla]] and [[User:Sik|Sik]] | ||
+ | |||
+ | {{S2Howtos}} | ||
+ | |{{PAGENAME}}]] |
Latest revision as of 10:52, 25 August 2018
(Original guide by Mikel, based on a guide by HPZMan)
Notes:
- Firstly, credit to HPZMan for the original guide he made for Sonic 1.
- Secondly, you need to have the Sonic 2 Clone Driver in your hack. To get the Clone Driver, go to this topic; it requires the Sonic 1 Sound Driver to be ported to your Sonic 2 hack first.
First, go to "PlayMusic:"
You will see something like this:
PlayMusic: ; tst.b ($FFFFFFE0).w ; bne.s + ; move.b d0,($FFFFFFE0).w move.b d0,($FFFFF00A).w rts + move.b d0,($FFFFF00A).w rts
Change it to:
PlayMusic: cmpi.b #$7F, d0 ble.s ChkSounds00to7F jmp NormalSoundRequest ChkSounds00to7F: cmpi.b #$01, d0 bge.s LoadSlots00to7F jmp NormalSoundRequest LoadSlots00to7F: add.b #$80, d0; Add $80 you get slot that starts in $81 move.b #$01, ($FFFFFFFC) .w; $FFFFFC moves $01 you you make sound to driver load secound index NormalSoundRequest: move.b d0, ($FFFFF00A) .w rts
Then, go to "PlaySound:".
You will see something like this:
PlaySound: move.b d0,($FFFFF00B).w rts
Change it to:
PlaySound: cmpi.b #$7F, d0 ble.s ChkSounds00to7F_Special jmp NormalSoundRequest_Special ChkSounds00to7F_Special: cmpi.b #$01, d0 bge.s LoadSlots00to7F_Special jmp NormalSoundRequest_Special LoadSlots00to7F_Special: add.b #$80, d0; Add $80 you get slot that starts in $81 move.b #$01, ($FFFFFFFC) .w; $FFFFFC moves $01 you you make sound to driver load secound index NormalSoundRequest_Special: move.b d0, ($FFFFF00B) .w rts
Then, go to "loc_7202C:"
You will see something like this:
loc_7202C: jsr sub_725CA(pc) movea.l (off_719A0).l,a4 subi.b #$81,d7 move.b (a4,d7.w),$29(a6) movea.l (Go_MusicIndex).l,a4
Change it to:
loc_7202C: jsr sub_725CA (PC) movea.l (off_719A0) .l, a4 subi.b #$81, d7 move.b (a4, d7.w), $29 (a6) movea.l (Go_MusicIndex) .l, a4 cmpi.b #$01, ($FFFFFFFC) .w bne.s NormalIndexLoad movea.l (Go_MusicIndex_01to1F) .l, a4 NormalIndexLoad: clr.w ($FFFFFFFC) .w
Then, search for "Go_MusicIndex:"
You will see something like this:
Go_MusicIndex: dc.l MusicIndex ; XREF: Sound_81to9F
Add this below "Go_MusicIndex:":
Go_MusicIndex_01to1F: dc.l MusicIndex_01plus
Then, go to "MusicIndex:"
You will see something like this:
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
Then, add this below "MusicIndex:"
MusicIndex_01plus: dc.l Music01, Music02
The "dc.l Music01, Music02" is basically an example of what music slots you should use for Slots $01 to any number you want to stop at
Then, go to "Sound_ChkValue:"
You should see something like this:
Sound_ChkValue: ; XREF: sub_71B4C moveq #0,d7 move.b 9(a6),d7 beq.w Sound_E4 bpl.s locret_71F8C move.b #$80,9(a6) ; reset music flag cmpi.b #$E0,d7 bge.s Sound_E0plus Sound_ChkValue_OtherChecks: cmpi.b #$FF,d7 bge.s Sound_E0toF8 cmpi.b #$9F,d7 ble.w Sound_81To9F cmpi.b #$F0,d7 ble.w Sound_A0ToCF cmpi.b #$F9,d7 bge.w Sound_E0toE4
Change it to:
Sound_ChkValue: ; XREF: sub_71B4C moveq #0, d7 move.b 9 (a6), d7 beq.w Sound_E4 bpl.s locret_71F8C move.b #$80,9 (a6); reset music flag cmpi.b #$E0,d7 bge.s Sound_E0plus cmpi.b #$01, ($FFFFFFFC) .w bne.s Load81to9F jmp Sound_ChkValueFor00 Load81to9F: cmpi.b #$9F, d7 bls.w Sound_81to9F; music $81-$9F Sound_ChkValue_OtherChecks: cmpi.b #$FF,d7 bge.s Sound_E0toF8 cmpi.b #$F0,d7 ble.w Sound_A0ToCF cmpi.b #$F9,d7 bge.w Sound_E0toE4
Now, go to "Sound_81to9F:", and change it to this:
Sound_ChkValueFor00: cmpi.b #$FF, d7; $FF = Last slot will be musics in index $00 - $7F ($FF = $7F) bls.w Sound_81to9F rts Sound_81to9F: ; XREF: Sound_ChkValue cmpi.b #$98,d7 ; is "extra life" music played? bne.s loc_72024 ; if not, branch tst.b $27(a6) bne.w loc_721B6 lea $40(a6),a5 moveq #9,d0
Finally, we are going to Change the number of sound test slots in the options and level select menus
To change the Options Sound Test,
Go to "word_917A:"
You will see something like this:
dc.w $7FFF ; 4 dc.w Sound_test_sound ; 5
Change the "$7" in "$7FFF" to anything you like, like "$FFFF", or "$CFFF"
To change the Level Select Sound Test,
Go to "loc_9522:"
You will see something like this:
loc_9522: cmpi.w #$15,(Level_select_zone).w bne.s loc_958A move.w (Sound_test_sound).w,d0 move.b (Ctrl_1_Press).w,d1 btst #2,d1 beq.s loc_953E subq.b #1,d0 bcc.s loc_953E moveq #$7F,d0
On the last moveq Change the "$7" in "$7F,d0" to mach the first two letters in the value you used above, like "$FF", or "$CF".
Go to "loc_954E:"
You will see something like this:
loc_954E: btst #6,d1 beq.s loc_955C addi.b #$10,d0 andi.b #$7F,d0
As before but on andi.b Change the "$7" in "$7F,d0" to the value you used above, like "$FF", or "$CF".
Lastly, Head back up to "loc_953E:" it should be between the two sections you just changed.
You will see something like this:
loc_953E: btst #3,d1 beq.s loc_954E addq.b #1,d0 cmpi.w #$80,d0 bcs.s loc_954E moveq #0,d0
change it to this:
loc_953E: btst #3,d1 beq.s loc_954E addq.b #1,d0
ADDITIONAL NOTES: Level Select Sound Test code was contributed by User:MattATobin with guidance from Ayla and Sik
|Expand the music index to start at $00 instead of $80 (Sonic 2 Clone Driver version)]]