Sonic and Sega Retro Message Board: Valley Bell's SMPS Research - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 6 Pages +
  • ◄ First
  • 4
  • 5
  • 6
    Locked
    Locked Forum

Valley Bell's SMPS Research includes lots of rips, disassemblies and hacking information

#76 User is offline Kurausukun 

Posted 31 January 2018 - 03:30 PM

  • Posts: 14
  • Joined: 09-July 16
  • Gender:Male
Sorry for the double post (though it has been a while), but I have a new question--it seems like Icecap Zone Act 1 from S3K is inaccurate; those effects that play specifically in the left and right channel at the start of the song are supposed to play each time that part of the music plays, but it only plays correctly the first time. The second time, only the left side plays, and subsequent times, neither of them play. I tried different versions of SMPSPlay, but they all have the same issue, so maybe the problem is with the file? Has anyone brought this up before, or am I doing something wrong?

#77 User is offline Orangy Tang 

Posted 20 April 2018 - 03:52 AM

  • Posts: 15
  • Joined: 24-June 11
This is a really awesome resource, but I'm having problems understanding it all.

I'm looking through the Gunstar Heroes rip (which seems to use SMPS68k/Type2b). I believe this also uses the generic z80 DAC driver. I've managed to extract the z80 binary myself, but is there a disassembled version of the generic DAC driver out there? There's game-specific DACs in the archive but I couldn't spot a generic one.

The other thing is what's the difference between the 'DAC' and 'DAC_Voice' binary files? I'm guessing the DAC files are actually part of the z80 rom (eg. Rips/68k/Gunstar Heroes/DAC/DAC_81.bin). I assume the dac_voice and music files must exist in the main ROM since there's not enough space in the z80 rom for those as well.

Thanks.

#78 User is offline ValleyBell 

Posted 21 April 2018 - 12:41 PM

  • Posts: 230
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10

View PostOrangy Tang, on 20 April 2018 - 03:52 AM, said:

This is a really awesome resource, but I'm having problems understanding it all.I'm looking through the Gunstar Heroes rip (which seems to use SMPS68k/Type2b). I believe this also uses the generic z80 DAC driver. I've managed to extract the z80 binary myself, but is there a disassembled version of the generic DAC driver out there? There's game-specific DACs in the archive but I couldn't spot a generic one.The other thing is what's the difference between the 'DAC' and 'DAC_Voice' binary files? I'm guessing the DAC files are actually part of the z80 rom (eg. Rips/68k/Gunstar Heroes/DAC/DAC_81.bin). I assume the dac_voice and music files must exist in the main ROM since there's not enough space in the z80 rom for those as well.Thanks.
Disassembled sound drivers are in "part 2" (DriverDisasm.7z). The generic DAC drivers can be found in Drivers/DACDrv/68k_DACDrv/GenericSMPS68k/. Disassemblies are game-specific, but if you look at them, they are all very similar.

You are right about the "DAC" and "DAC_Voice" folders. DAC drums usually fit within the Z80's 8 KB of RAM. DAC voices and sound effects are a bit larger and read directly from the ROM.


View PostKurausukun, on 31 January 2018 - 03:30 PM, said:

Sorry for the double post (though it has been a while), but I have a new question--it seems like Icecap Zone Act 1 from S3K is inaccurate; those effects that play specifically in the left and right channel at the start of the song are supposed to play each time that part of the music plays, but it only plays correctly the first time. The second time, only the left side plays, and subsequent times, neither of them play. I tried different versions of SMPSPlay, but they all have the same issue, so maybe the problem is with the file? Has anyone brought this up before, or am I doing something wrong?
Thanks for reporting that! I checked what goes wrong and it turns out I made a mistake when porting the volume clipping code from S3K's sound driver. (Volume clipping is unique to S3K only, that's why I didn't notice it when listening to all the other SMPS stuff.)
It will be fixed in the next release. (It's fixed by this Git commit.)

(Sorry for the late response, but I wanted to check the issue before replying and kept forgetting to do so.)


About SMPS ASM - you turn them back into binary files using an assembler. Basically you take the AS assembler from the S2/S3K disassembly and make it assemble a minimal Main.asm file that just includes some macros, the smps2asm include file and the ASM'ed SMPS file itself. It's been a while since I did this though.

If you want to know what sorts of commands you can use in SMPS, you should check SCHG:Music_Hacking/DAC_Samples,_Coordination_Flags,_Game_Specifics,_and_Real-Time_Music_Editing, section "Coordination flags". The names for all commands are listed in the smps2asm include file.

#79 User is offline Orangy Tang 

Posted 21 April 2018 - 02:47 PM

  • Posts: 15
  • Joined: 24-June 11

View PostValleyBell, on 21 April 2018 - 12:41 PM, said:

Disassembled sound drivers are in "part 2" (DriverDisasm.7z). The generic DAC drivers can be found in Drivers/DACDrv/68k_DACDrv/GenericSMPS68k/. Disassemblies are game-specific, but if you look at them, they are all very similar.

Yeah, I found that eventually after I confused myself a few times. I've managed to decompile the Gunstar Heroes Z80 rom using the existing ones for reference, so thanks. :)

Can I ask how you extracted the DAC banks from the z80 rom? Gunstar Heroes has DAC banks 81 to 88 (but missing 85 for some reason). How did you figure out where the boundaries between these are and what their ids are?

.
This post has been edited by Orangy Tang: 21 April 2018 - 02:49 PM

#80 User is offline ValleyBell 

Posted 22 April 2018 - 10:59 AM

  • Posts: 230
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
I extracted the DAC samples with SMPSExtract. It scans the complete game ROM for some magic bytes in order to locate the code that reads (or sets up) the DAC tables. (It also decompresses the Z80 driver where possible and scans that as well.)

The trick there is, that samples which are stored in Z80 RAM have their own sample table (also in Z80 RAM) and begin with ID 81. Missing IDs in the file names indicate invalid samples OR that the ID reuses a previous sample (i.e. same file offset/length). The latter is the case for Gunstar Heroes' DAC 85. Just look at DAC.ini and it will become obvious.
DAC voices have their own sample table(s) - one in every Z80 ROM bank (32 KB block of the main ROM) that contains DAC voices. The format of the file name for those is "DAC_BankID-SoundID.bin". (SoundID begins with 0 for each bank.)
Getting the actual internal ID for DAC voices requires you to look at the DAC driver's Z80 code, but they often begin at ID 88.

  • 6 Pages +
  • ◄ First
  • 4
  • 5
  • 6
    Locked
    Locked Forum

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