How to restore Sonic 1 prototype drums

Discussion in 'Tutorials' started by SomeUser214, Jun 1, 2021.

  1. SomeUser214

    SomeUser214 Newcomer Trialist

    Joined:
    Dec 22, 2020
    Messages:
    9
    Recently, I figured out how to restore Sonic 1 prototype drums, so I decided to make this guide.
    Thanks to Clownacy, Speems, and JGamer2151 for telling me a more accurate way to restore the prototype drums.
    Step 1:
    Go to the "sound" folder and open up "z80.asm" in a text editor. Once you have done that, replace this
    Code:
    zPCM_Table:
        dw    zDAC_Sample1    ; Kick sample
        dw    (zDAC_Sample1_End-zDAC_Sample1)
        dw    0017h            ; Pitch = 17h
        dw    0000h
    
        dw    zDAC_Sample2    ; Snare sample
        dw    (zDAC_Sample2_End-zDAC_Sample2)
        dw    0001h            ; Pitch = 1h
        dw    0000h
    
        dw    zDAC_Sample3    ; Timpani sample
        dw    (zDAC_Sample3_End-zDAC_Sample3)
    zSample3_Pitch:
        dw    001Bh            ; Pitch = 1Bh
        dw    0000h
    with this
    Code:
    zPCM_Table:
        dw    zDAC_Sample1    ; Kick sample
        dw    (zDAC_Sample1_End-zDAC_Sample1)
        dw    0019h            ; Pitch = 19h
        dw    0000h
    
        dw    zDAC_Sample2    ; Snare sample
        dw    (zDAC_Sample2_End-zDAC_Sample2)
        dw    0006h            ; Pitch = 6h
        dw    0000h
    
        dw    zDAC_Sample3    ; Timpani sample
        dw    (zDAC_Sample3_End-zDAC_Sample3)
    zSample3_Pitch:
        dw    0020h            ; Pitch = 20h
        dw    0000h
    Then save the file.
    Step 2:
    Next, go to s1.sounddriver.asm, and find "DAC_sample_rate:". Once you did, replace this
    Code:
    dc.b $12, $15, $1C, $1D, $FF, $FF
    with this
    Code:
    dc.b $17, $1A, $21, $22, $FF, $FF
    Then save the file, and your done!
     
    Last edited: Jun 2, 2021
  2. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    930
    ...Huh? I don't think that's the way you're meant to do it. The drum files are the same in both the prototype and the final version of the game. What makes them sound different is the speed they play at: the prototype has different speeds, giving the drums different pitches. I imagine the reason what you're doing works is because the speed values Mega PCM uses for Sonic 3's drums happen to result in a similar pitch to the values used by Sonic 1's prototype, so swapping the drums without correcting the speed values happens to create drums that sound like they do in the prototype.

    The speed values can be found here (labelled 'pitch'), in the DAC driver. Higher numbers create lower pitches/speeds. I don't know exactly which numbers are needed to recreate the prototype drums, but you can experiment to figure them out. Note that the disassembled Z80 driver only exists in the AS branch of the Sonic 1 disassembly, so you have to use that if you want to make this modification.
     
    Last edited: Jun 1, 2021
  3. Speems

    Speems Well-Known Member Member

    Joined:
    Mar 14, 2017
    Messages:
    59
    Location:
    Rochester Hills, MI
    Yeah, Mega PCM is not how you would restore the prototype drums for perfect accuracy. Especially since it doesn't sound exact since it plays the 16Khz versions of the samples due to how it's set up. So when it comes to Clownacy's idea of editing the speed value, it sounds more legitimate and a good way the proto drums and the Sega chant can be together. For the kick, add 2 (19h). The snare requires an addition of 5 (6h). Currently trying to figure out the right digit for the third sample (timpani) but I can confirm it sounds more accurate while playing it alongside the ripped samples through a certain emulator's sound layer tricks.
     
  4. JGamer2151

    JGamer2151 Newcomer Trialist

    Joined:
    Dec 1, 2020
    Messages:
    9
    Alright, so I have figured out the proto pitches (speed values) for the timpani sample (the third sample) while comparing the proto ROM to my Sonic 1 test ROM with this guide applied. This is essentially continuing on from where Speems left off. Basically, I had to add the pitch of the timpani sample by 5 (20h) just like with the snare drum sample, and then go into s1.sounddriver.asm and change the four values of the timpani samples at DAC_sample_rate: before the two $FFs to be an addition of 5.

    For example, we'll go to "DAC_sample_rate" and see this:
    Code:
    dc.b $12, $15, $1C, $1D, $FF, $FF
    We can change those four values by adding them by 5, giving our result of this:
    Code:
    dc.b $17, $1A, $21, $22, $FF, $FF
    With that being said, this additional method restores the Sonic 1 proto samples in the finalized build of Sonic 1.

    And hey, this was my second post here on this forum. Hello again!
     
    Last edited: Jun 1, 2021
  5. Speems

    Speems Well-Known Member Member

    Joined:
    Mar 14, 2017
    Messages:
    59
    Location:
    Rochester Hills, MI
    I can confirm both of these work and sound like a perfect implementation of the proto drums in Sonic 1 final, at least for the AS disassembly. The primary GitHub and Hivebrain disassemblies need their own methods of restoring the proto drums, with bonus points for retaining the Sega chant like with this.
     
  6. Mr. Joker 27 Music prod.

    Mr. Joker 27 Music prod. Musician, composer, remixer. Member

    Joined:
    Aug 26, 2016
    Messages:
    232
    I remember hearing these samples in an old hack called 30 Days Challenge, so now I see that it can be modified not only in MegaPCM. I must also explore the values in the original disassembly to see the rate as it works.
    So the values can be raised up to 5 hz, the maximum I guess is 12 hz, no?