devinacker / bsnes-plus

debug-oriented fork of bsnes
http://bsnes.revenant1.net
326 stars 92 forks source link

xml top gear 3000 problems #139

Closed ghost closed 6 years ago

ghost commented 7 years ago

Hi, this isn't an issue, but a request for help for creating a xml for Top Gear 3000. I do not know where to ask elsewhere. I created a msu1 patch for this game, and want to make it compatible with bsnes: https://www.zeldix.net/t1495-top-gear-3000

If I use bsnes 91 purify option, I get this xml: `<?xml version="1.0" encoding="UTF-8"?>

` So I tried to fill in the correct stuff, so that bsnes 0.73 can load it as well, e.g., dsp4.rom -> dsp4.bin and so on. Here's my try: ` ` But equally what I try (and I tried a lot), it remains on black screen :( - could you please help me finding a correct xml?
mrehkopf commented 7 years ago

On a side note, this probably won't work on sd2snes as it stands. For any LoROM size >8Mbits the DSP is supposed to be mapped to 60-6f:0000-3fff(DR) / 4000-7fff(SR). Interestingly I just stumbled upon this with an expanded DSP3 ROM hack (SD Gundam GX). The obvious reason is that ROM and DSPx MMIO would otherwise overlap from bank 20 onwards. So the sd2snes, as with Super Bases Loaded 2, would map the DSP4 to the abovementioned location where the game won't expect it. I'm currently pondering whether it would be a good idea to make that decision for DSP1(b) ROMs only (as all emulators do) and always map to 30-3f:8000-ffff for DSP2-4 even though it would create a "hole" in the ROM mapping... IMO it would be better to convince emulator authors to do the opposite =)

Regarding the actual problem at hand, I'm not sure how bsnes handles ROM/MMIO overlap. Maybe it could help to map ROM to 00-2f / 80-af only to make room for the DSP4 area. I might give it a shot later today if I have the opportunity.

ghost commented 7 years ago

Hi Max, didn't expect to meet you here :D

Yes, Kurrono also reported problems with sd2snes (but I am not sure, I do not own one), is TG3k playable?

Strange is that the xml as bsnes .91 creates it works, but as soon I try to edit it to .73 it will not load. I hope your shot will be of success, I'm absolutely no expert when it comes to xml ;)

mrehkopf commented 7 years ago

OK, got it to work. Some things I spotted: Suggested ROM basename out of the box (via IPS file) is "tg3k_msu" but the MSU file basename is "tg3k_msu1". This resulted in no MSU1 sound before renaming the sfc file to "tg3k_msu1.sfc". bsnes-plus likes the SHA256 sum to be written in lowercase, I literally got a warning that the calculated checksum for dsp4.bin was 63ede17e... but the manifest expects 63EDE17E... wow. Then the particular bsnes version bsnes-plus is based on wants the dr and sr elements to be written a bit differently. Oh, and of course the containing folder must end in '.sfc'. Otherwise it won't load any manifest at all... Here's the final tg3k_msu1.xml:

<?xml version="1.0" encoding="UTF-8"?><cartridge region="NTSC">
   <rom>
      <map mode="linear" address="00-7f:8000-ffff"/>
      <map mode="linear" address="80-ff:8000-ffff"/>
   </rom>
   <necdsp revision="uPD7725" frequency="8000000" program="dsp4.bin" sha256="63ede17322541c191ed1fdf683872554a0a57306496afc43c59de7c01a6e764a">
      <dr mask="004000" test="000000"/>
      <sr mask="004000" test="004000"/>
      <map address="30-3f:8000-ffff"/>
      <map address="b0-bf:8000-ffff"/>
   </necdsp>
   <msu1>
      <mmio>
         <map address="00-3f:2000-2007"/>
         <map address="80-bf:2000-2007"/>
      </mmio>
   </msu1>
</cartridge>
ghost commented 7 years ago

Thanks so much now it works in bsnes+ I did not try these test and mask values, this surely will help if I get in the future in such pain :)

I find quite odd: bsnes v70 still does not load it: http://bszelda.zeldalegends.net/stuff/Con/bsnes_v070.zip

But don't mind, I am happy with bsnes 73, there were so many policy changes and bsnes 91 uses again a different xml, and even a different dsp (dsp4.bin -> dsp4.rom)

I uploaded everything: http://bszelda.zeldalegends.net/stuff/Con/tg3k_msu.zip (dsp4.bin, xml for bsnes 73, dsp4.data.rom, dsp4.program.rom for higan and described in the tutorial how to setup each system, so I'm content :D

Regarding the ips called "tg3k_msu.ips" and the .msu, .pcm and .sfc are called "tg3k_msu1." is that some emulators have an autopatch function and if the patch is called equally to the gamename, it will always be applied. I had a complain regarding this, so I choose to name the patch file differently to the game required files.

I also described it in the readme how the names must be. There are so many emulators and versions, I try to make it compatible for everything, but... ....

devinacker commented 6 years ago

Hi, sorry for such a late response, but current builds (as of August 2017) will automatically detect MSU-1 ROMs as long as a correctly named .msu file is present. Hopefully this means you also don't need a custom manifest file for Top Gear 3000, as long as the only difference in the manifest was the <msu1> element.

(You'd still need to create one for compatibility with the old bsnes 073 and so on, unfortunately.)