Shekel wrote:Would you be able to change just one thing for this music hack?

No rush, though.
Somehow just load files on a per-game basis? Doesn't seem like I can work around 2 games using the same address, unless there's already a way.
The right way to do it is to pass the game object down to the DSB but that would require you to modify more than one file each time you pull from SVN. So a hackier way to do it is use an if-statement that tests the loaded MPEG ROM for signature bytes.
You can do it using a hex editor on the first of the two ROMs. Or you can print out the first few bytes by inserting this handy-dandy piece of code anywhere in CDSB1::Reset() and CDSB2::Reset():
- Code: Select all
for (int i = 0; i < 16; i++)
{
printf("mpegROM[0x%02x] == 0x%02x\n", i, mpegROM[i]);
}
This will print out the first 16 bytes of the MPEG ROM space. Dollars to donuts these will be unique based on the game. Find a series of bytes (maybe only a single byte is needed) to identify the game. Let's pretend it's bytes 5 and 6. You would then enclose your LoadMP2File() calls like this:
- Code: Select all
if (mpegROM[0x05] == 0xaa && mpegROM[0x06] == 0xbb) // if byte 5 is 0xaa AND byte 0x06 is 0xbb, then Daytona 2 detected
{
LoadMP2File(...);
...
} else if (mpegROM[0x05] == 0x12 && mpegROM[0x06] == 0x13) // Sega Rally 2 detected
{
...
}
else
printf("Unable to detect game. Not loading any custom music.\n");
I don't have the emulator handy right now so you'll have to find the real values yourself. These were just made up as examples. You may also only need to check a single byte if you can find one that is unique to each game. Then your test will simply be something like:
- Code: Select all
if (mpegROM[0x03] == 0x59)
Hope that makes sense. This is a hideous hack but if it works it works
