vgmrips

The forum about vgm files
It is currently 2017-11-19, 16:03:03

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2013-12-04, 14:01:19 

Contributors Contributors
Offline
User avatar

Joined: 2012-05-04, 13:55:03
Posts: 106
Location: Seattle
Hello, everyone. Sorry if by chance I posted in the wrong place.
I am currently trying to rip a VGM set for the Mega Drive game Hurricanes. However, I am not familiar with music modifiers, but I know they exist for some games. I was wondering how to find them for Mega Drive games like this? I tried the State mode on Fusion (clicked Same when the same song was playing, clicked change when another song was playing but ended coming up empty-handed). If anyone could help me with this issue, I would greatly appreciate it. Maybe there's an easier way than Fusion?
Thanks for your time.


Top
 Profile  
 
 Post subject:
PostPosted: 2013-12-05, 0:58:17 

Staff Staff
Programmers Programmers
Musicians Musicians
Contributors Contributors
Offline
User avatar

Joined: 2011-12-01, 20:20:07
Posts: 2843
Location: Germany
There is no general guide to find memory triggers that works with every game, you maybe the guide on SMSPower can help you.

Anyway, I always use MESS' debugger to search for such things.

For this game, the sound driver runs on the Z80, so interrupted the emulation and while the "maincpu" (68000) is active, I set a watchpoint over a part of the Z80 RAM area.
Code:
wpset A00000,100,w
(Values are hexadecimal by default. The whole Z80 RAM area is A00000 to A01FFF actually, but I didn't want to risk slowdowns, so I picked just the first 0x100 bytes.)

The important thing here is, that the 68k processor asks the Z80 to play music and sound effects. It does this by writing to the Z80 RAM area, so if you find out what values it writes there and where it writes them, you can find some memory triggers.

Common locations are: (Z80 RAM offsets, 68k address is A0xxxx)
  • 1C0A, values are 80+ (usual SMPS sound driver, 1C0B is also possible but mainly used for SFX)
  • 1FFC, values are 00+ (Wonderboy sound driver?, found in the Tiny Toon Adventures 3 pirate)
GEMS is a bit lot more complicated, so I left it out here.

THIS game however has the memory trigger at 0004/0005. Also it works in a pretty weird way.
The value at 0004 seems to identify the routine that has to be called and must be a multiple of 2. (00 = do nothing [default], 02 = Stop Music, 04 = Play Music, 06 = Play SFX, 0E = ??)
0005 is the parameter, i.e. sound or music ID.
(Note: Finding this out wasn't trivial in this case.)

So if you're using MESS to log VGMs, you can play a song this way:
1. Interrupt the emulation and open the debugger. (see Input (general) -> User Interface -> Break in Debugger to change/view the key)
2. In the debugging window, click Debug -> Run to Next CPU until it shows "Z80" in the window's title.
3. type this into the small command line: (xx - music number)
Code:
b@0004 = 04; b@0005 = xx
4. press enter to execute it and press F5 to continue the emulation.

If you want to play another song, you can just execute the line above with a different number. As long as the disassembly window shows "Z80" in its title, you don't even need to stop the emulation.

To stop the music, execute:
Code:
b@0004 = 02

The only music IDs that seem to work are 00..09 (actual music) and 0C (some voice).


Note: If you use Kega Fusion, you should have success by hex-editing save states. I find the command line of MESS a lot more comfortable though.


Top
 Profile  
 
 Post subject:
PostPosted: 2013-12-05, 1:09:40 

Contributors Contributors
Offline
User avatar

Joined: 2012-05-04, 13:55:03
Posts: 106
Location: Seattle
Thanks a bunch for the help! I'll take a look at the guide at SMSPower. I use Fusion. Is there a code you can use that will play a certain song? For example, if I want the title music to play on the first level, would there be a code like FF####:####?
Again, thanks so much, I really appreciate it!

What's weird about this game is that it doesn't use Mark Cooksey's sound engine. One of the programmers said it was probably done by Chris Coupe (Chibsy). This game also has no audio credits, but I got Andi McGinty as the composer.


Last edited by MusicFox on 2013-12-05, 1:10:33, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: 2013-12-05, 1:50:58 

Staff Staff
Programmers Programmers
Musicians Musicians
Contributors Contributors
Offline
User avatar

Joined: 2011-12-01, 20:20:07
Posts: 2843
Location: Germany
I don't think there is a PAR code that does what you want.
FFxxxx marks the 68k's RAM. Also a PAR code would restart the music every frame and you don't want that.

I'd probably make a save state at the options screen and would edit the save state to make the music play there.

EDIT: You can find information about the .gsx save format on Sonic Retro. (It's the first table.)


Top
 Profile  
 
 Post subject:
PostPosted: 2013-12-05, 1:52:43 

Contributors Contributors
Offline
User avatar

Joined: 2012-05-04, 13:55:03
Posts: 106
Location: Seattle
Ah. I guess that explains why I couldn't find a music editor for that!
So which address would you edit for the song if you were to open the state in a hex editor?


Top
 Profile  
 
 Post subject:
PostPosted: 2013-12-05, 6:33:29 

Contributors Contributors
Offline
User avatar

Joined: 2011-12-13, 17:31:14
Posts: 397
Location: Earth Planet
ValleyBell wrote:
Common locations are: (Z80 RAM offsets, 68k address is A0xxxx)
  • 1C0A, values are 80+ (usual SMPS sound driver, 1C0B is also possible but mainly used for SFX)


Some SCD and 32x games use these methods. However, be careful when done this with SCD games, as they cannot change the RF-part (i.e: Super League CD, Dynamic Country Club).

For Pico games, they are in M68k at FFF009, since it no have Z80. Sonic's GameWorld and Pokémon T. o S. are two examples that use SMPS (Tails and TMM, McDonald de Asobou!, Donald no TV Show and Toy Story 2 are others):

https://www.dropbox.com/s/t2h21h3l0kcwxl1/PicoDebug.png

_________________
オモいカルチャーをオモチャーと言う - 細野晴臣


Top
 Profile  
 
 Post subject:
PostPosted: 2013-12-10, 17:01:22 

Contributors Contributors
Offline
User avatar

Joined: 2012-05-04, 13:55:03
Posts: 106
Location: Seattle
Hey, ValleyBell. I sent you a message about this matter.
I tried to run the game in MESS, but not only are some of the graphics glitched, but the game runs too fast. I'm not sure if there's a way to fix this. I don't mind hex editing the save state, but I don't know which address I'm supposed to edit for the music. I looked at the link you sent but I still don't understand.

EDIT: The game runs okay in MESS now but some of the graphics are still glitched. Also, it won't let me open the debugger. I set a key to it but in the user interface menu, the Break in Debugger key is in grey.


Last edited by MusicFox on 2013-12-10, 17:04:08, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: grauw, Linkdex [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group