Skip to content

Need help ripping sfiii3rd strike (non vgm format)

Technical discussion which is not directly related to VGM files. Talk about Hardware and Software.

Moderator: Staff

Post by insertnamehere »

ctr, i am posting here since i have bad timing posting the irc chat, and you didn't see my messages, but i think i have found what i belive is the lfo table (its found between 0x660d144 and 0x660e944).
but its not really a waveform, its more of a linear table, and its doing something similar to a sine operation to the pointer offset.
i have made a bin file rip [url = ... sp=sharing]here[/url], and [url = ... sp=sharing]i have made a snapshot of the routine[/url], also i wanted to include a snippet of the assembly code, but i don't know if is trash
i have written this "quickly" before my pc gets repaired
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

That looks to just be a pitch table. I.E. the values that are written to the sound chip to specify the sound frequency. It's obvious since the highest value is about twice as big as the first value in the table, indicating that it covers an octave. Also there are 6144 16-bit values, divided by 12 that gives exactly 512 'cents' or fractions in a semitone. The LFO vibrato is created by modulating the frequency value (which as you say is a pointer into this table), meaning the sine function or table is somewhere else.

To get lower or higher octaves, the values are just shifted as necessary.

Post by insertnamehere »

ctr, i have found a part of the lfo processing code, its after the address 0x0613BA10.
if you have time to investigate more on it someday, and explain me what it does, that would be really cool

EDIT: just found out it was not the right block of code, i have edited the right one now.

and the summary i wrote before was confusing, so there is a new one, from what i have seen.. (for reference, i am using channel 0x09 in song 0x1e, the vibrato depth here is 0xe2, and the lfo speed is 0x76da, converted from the tables).

so, it multiplies the lfo speed for the vibrato depth, to get a value (for semplicity i am going to refer it as lfo_val_per_phase), for finding the minimum lfo value, in register 6, the vibrato depth value is shifted by 16 bits, and it subtracts this to lfo_val_per_phase.

then, in address 0x207913c, i think is stored the current lfo value, and it subtracts the (lfo_val_per_phase) to the current lfo value (current lfo value - lfo_val_per_phase)

Post by insertnamehere »

i have managed to make a (bad) transcription of the code starting from 0613BA10, that handles the current lfo value.

Code: Select all

cps3 vibrato code transcribed

starting from 0613BA10
before anything happens, load vibrato rate (register 6) and depth (register 5)
multiply the two for vib_depth_per_rate, and override vibrato rate with it(register 5).
the value contained in address (r14 (the start of channel 10 work area, in this case 2079120) + 0x6e)
gets saved to register 3.
then, if (r3 != r8 (seems to be always 1)), goto 613ba60, else continue to 613ba3c;
shift r6 left by 16 bits regardless

613ba3c: move the current lfo value to r3, move r5 (vib_depth_per_rate) to r2, subtract it to r6 (vibrato rate << 16), and if (r2 >= r3), branch to 613ba50, else, continue to 613ba48.
load the current lfo value (in address r14 + 0x1c) to register 1, then subtract r5 to r1, and goto 0613BA6e:
move the result to the address for current lfo value.

613ba50: move 0xfe to r3, then arithmetically reverse r6 (-r6), and move r6 to the address of the current lfo value, then:
load the value inside (r14 + r0), then (r2 & r3), and save that to r14 + r0.

613ba60: move r6 (vibrato rate << 16) to r3, move the previous lfo value to r2, subtract r5 (vib_depth_per_rate) to r3.
if (r3 >= r2): goto 613ba72, else, move again the previous lfo value to r1, add r5 to r1, move the result to the address for previous lfo value.

613ba72: move 0x6e to r0, move r6 (vibrato rate << 16) to the previous lfo value, move 0x01 to r3, move the value of (r14 + r0) to r2, then (r2 | r3), and move the result to (r14 + r0).

r14 + r0 seems to contain the current lfo state (i.e. rising, falling, ect...)
and r8 may refer to a specific lfo state (maybe rising, as the algorithm that gets branched to when (r3 & r8) is true, produces values bigger than the previous lfo value) 
maybe i can make a piece of c code that replicates this.

Edit: there was stuff that was wrong, now i have corrected it (or at least partially)

Post by insertnamehere »

so, i got the lfo emulator to run at the rigth tick frequency with different tempos, and to find the start of the function that converts the lfo value into an usable value for the pitch table, but in that bllock of code, it uses a value that is derived from the current note begin played (at channel 0x09 (counting from zero), its located at 0x2079130, 2079132 and 2079134)
but i can't figure out where the block of code that determines that value, my tracefiles do not include it, when i try to make an another one and i cannot trigger songs in the sound test because its slow and locks me out of any input.
i was thinking of putting a watch point on a note in the song's data...

Edit: i think i found it:
to turn the note value into an usable variable, it subtracts the intrument sample's key center, then adds 7, shifth by 2, left, subtracts the value inside (current_channel_offset + 0x56), and adds 0x80, and adds again the value at (0x6788848 + 0x6, the 7th byte in an instrument key split)
  • Mike77154 Offline
  • Posts: 8
  • Joined: 2019-05-03, 5:49:33

adding your work to VGMTrans

Post by Mike77154 »

Hello friend, I was messing around your midis and the soundfont ripped, but Now I want to ask you if you can let me use your method (and if you could teach me please how to achieve it) of ripping midis and soundfont from cps3, and add it to VGMtrans open source code, because it would be great if we had CPS3 support of every game of cps3 in VGMtrans, maybe we have all the Qsound collection support for VGMtrans (you know, Cps Dash, CPS2, CPS3 thanks to you, Zn-1, Zn-2 and why not? classic YM2151 CPS1 too)

thanks in advance

admin edit: removed fullquote

Street Fighter III music series (CPS-III)


I'm surprised that it's been over a year since I last posted the Street Fighter III music series topic. If the user Mike77154 can make this to work to help out insertnamehere with the project, I would be in relieved and hoping the series would be done before the year ends. I was also looking forward to see all the Street Fighter III series on the list for us fans to listen to. I still love the bass and the drums and I'm dying to listen to them on the instrumental channels. I'm still not giving up hope since this is the 20th Anniversary of Street Fighter III: 3rd Strike and I know you guys can work together to get the project done in no time. Best of luck.

Post by insertnamehere »

DRAGONUNKNOWN, that mike was actually not related with the official vgmtrans page.
there is a user by the name of: Mikelow, but it's not the same

for the time of this reply, i don't have my old pc, i transfered, it doesn't have cps32mid, i need to download from my github

Edit: new version
songs and sf2 updated
(5.34 MiB) Downloaded 456 times
  • Mike77154 Offline
  • Posts: 8
  • Joined: 2019-05-03, 5:49:33

Post by Mike77154 »

insertnamehere wrote:DRAGONUNKNOWN, that mike was actually not related with the official vgmtrans page.
there is a user by the name of: Mikelow, but it's not the same

for the time of this reply, i don't have my old pc, i transfered, it doesn't have cps32mid, i need to download from my github

Edit: new version
songs and sf2 updated
Man, really I want to help you, can I join to your project?

Post by insertnamehere »

I don't really know.

cps32mid is almost done, but i work on it very slowly after long breaks, and there are 2 issues:
vibrato clashes with, on a number of songs, portamneto;
the mixing is meh (instruments too quiet, incorrect adsr since i don't use the vgmtrans code, etc).

then, after that, i need to dump bin files of instruments, sample data, and sequences of the other 5 games, but i need first to figure out the addresses of all of them.

i can ask you to do that, you grab mame, booth it up with
automatic debug mode.7z
this file
(197 Bytes) Downloaded 353 times
, and booth up a """"legit"""" copy of these games, and find these using the memory browser (debug->new memory window), but i'm not sure you can do it, so i don't know if i can...
it's boring (so much boring).

i can give you some clues, you may not find them useful, but here:
find one of them, and you have a greater chance of finding the other 2
as all these chunks are 0x4000 bytes big, so in the address search bar, the very start address that you found one of these, an add or subtract 0x4000, or a multiple of it, to navigate throhough these chunks,
and you specifically want to search for the sample data first, it contains information about a sample, the start offset, the end offset, the foint where the loop starts, and key.
it looks like this: ... sp=sharing
it's the easiest to see, and also the first chunk of data, so the instruments will be at the start address you find the chunk in + 0x4000, and consequentely the sequences are in that start address of instruments + 0x4000

maybe for the code too, you would need to use the mame debugger to figure out what to do, for resolving one of these issues, wrapping you head around all of that is going to be hard, unless you used it before...

or you can do something else you think can help.

Edit: ask here for any problems/questions you may have

Post by MixerProductions »

First of all thank you SOOO much bro you don't understand how much this means to us! I don't know anything about coding and all of the hard work that goes into what you do! I posted here a few pages back and never imagined that this project would ever get to this point!

I actually started a remix album of SF3 Third Strike a year ago, transcribing the songs from scratch! The melodies are fairly simple to work out by ear but the samples and intricate D&B drum patterns were really hard to recreate!

Thanks to you and the guys here I have been able to make even more accurate remixes of it! Please dont give up and try and get SF3 New Gen and 2nd Impact cracked at some point too, 2I is one of Capcoms best! Red Earth and JoJo would be appreciated too but I understand if it's not possible or too much work for one guy!

If you ever needed donations I would be willing to support you on Patreon or Paypal! 8|

Post by insertnamehere »

vibrato/pitchbend conflict issue has been solved

adsr is still broken, but this we fix in the future

test run for everybody that wants:
sfiii3 ... sp=sharing
sfiii2 ... sp=sharing

EDIT: quick fix for sfiii2, song 15 had broken loops
(5.33 MiB) Downloaded 338 times

Post by MixerProductions »

Best Christmas present ever! thank you, you've just made a ton of people happy with the wave of remixes that will come from this!

Patiently waiting New Generation, Warzard/Red Earth and JoJo :D

Post by insertnamehere »

fixed adsr, but volume is weird, here's jojo, but not really, its more like joejoe. ... sp=sharing

Post by insertnamehere »

managed to get the right mixing, thanks to valleybell, and ctr, and managed to fix a bug that prevented a jojo song to loop propely, it was song 26, at channel 0, the only problem now is a strange tuning for the capcom logo jingle, in the code for vibrato, there is a parameter that was probably taken from an instrument, and signifies the detuning, not remembering where it was, but will get fixed

jojoban: ... sp=sharing
sfiii3n: ... sp=sharing
sfiii2n: ... sp=sharing
Post Reply