devinacker / bsnes-plus

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

MSU-1 on BS-X cartridges #165

Closed Phillip-May closed 6 years ago

Phillip-May commented 6 years ago

Is it possible to do use custom ROM mapping on a BS-X cartridge to add MSU-1 support without having to patch the ROM to make it standalone like the BS Zelda translation did?

I am trying to add msu-1 mapping to a bs-x cartridge and whenever I try to load a cartridge using the BS-X bio and my game.xml it gives error 08 implying the memory mapping is messed up.

My current xml file for reference

<?xml version="1.0" encoding="UTF-8"?>
<cartridge region="NTSC">
  <bsx>
    <mcu>
      <map address="00-3f:8000-ffff"/>
      <map address="80-bf:8000-ffff"/>
      <map address="40-7f:0000-ffff"/>
      <map address="c0-ff:0000-ffff"/>
      <map address="20-3f:6000-7fff"/>
    </mcu>
    <mmio>
      <map address="00-3f:5000-5fff"/>
      <map address="80-bf:5000-5fff"/>
    </mmio>
  </bsx>
  <rom>
    <map mode="linear" address="00-6f:8000-ffff"/>
    <map mode="linear" address="80-ff:8000-ffff"/>
  </rom>

  <ram size="2000">
    <map mode="linear" address="70:0000-2fff"/>
  </ram>

  <msu1>
    <map address="00-3f:2000-2007"/>
    <map address="80-bf:2000-2007"/>
    <mmio>
      <map address="00-3f:2000-2007"/>
      <map address="80-bf:2000-2007"/>
    </mmio>
  </msu1> 
</cartridge>
devinacker commented 6 years ago

This is what an automatically generated manifest for the BS-X base cartridge looks like:

<?xml version='1.0' encoding='UTF-8'?>
<cartridge region='NTSC'>
  <rom>
    <map mode='linear' address='00-3f:8000-ffff'/>
    <map mode='linear' address='80-bf:8000-ffff'/>
  </rom>
  <ram size='8000'>
    <map mode='linear' address='10-17:5000-5fff'/>
  </ram>
  <bsx>
    <mcc>
      <map address='00-0f:5000-5fff'/>
    </mcc>
  </bsx>
</cartridge>

Adding the normal msu1 element to the above should work.

Keep in mind this manifest applies to the base cartridge, not the memory pack containing the actual game (these have manifests too, but any memory mapping information in them is ignored).

Phillip-May commented 6 years ago

From my testing and what you said it seems to inherit from the BS-X BIOS, the msu-1 chip keeps giving me the track not found error, where does the emulator look for MSU audio tracks when you load a BS-X cartridge?

After some testing, it appears to check in the folder the bios is located in. This seems a bit unintuitive but is workable. If this was documented somewhere and I missed it, I am sorry for bothering you. I tried looking at the auto generated manifest but that required me compiling a newer version of bsnes plus myself and I am really bad at setting up tool chains.

I am curious as to how the SD2SNES handles this but that is another days problem.

Thank you for helping me with my issue.