Author Topic: My SD2SNES cannot run ExLoRom game  (Read 4144 times)

0 Members and 1 Guest are viewing this topic.

Offline Quirino

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
My SD2SNES cannot run ExLoRom game
« on: January 19, 2018, 09:32 PM »
Hi everyone. I bought an SD2SNES recently in order to be able to play fan translations of Japanese games on original hardware. One of the patches I wanted to run was the one in the following topic: https://serenesforest.net/forums/index.php?/topic/80126-fe5-unified-thracia-prototype-menu-and-script-translation-through-ch-3/

It is a fan translation patch of Fire Emblem Thracia 776, which is a LoRom. The patch expands the rom, which causes incompatibility with several emulators according to the patch creator. I couldn't get it to work on my SD2SNES either, the graphics were all over the place, screenshots in this post: https://serenesforest.net/forums/index.php?/topic/72037-thracia-776-complete-menu-translation-vwf-double-rng/&do=findComment&comment=5049729.

I was wondering if anyone knows what causes this, and, more importantly, if I can do anything to make the patched rom work on my SD2SNES.

Thanks for the help :)
« Last Edit: January 19, 2018, 09:42 PM by Quirino »

Offline ikari_01

  • Sr. Member
  • ****
  • Posts: 309
  • Karma: +80/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #1 on: January 21, 2018, 04:20 PM »
I might need to add support for that specific memory layout. How big is the resulting ROM?

Offline TheShadowRunner

  • Full Member
  • ***
  • Posts: 117
  • Karma: +8/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #2 on: January 21, 2018, 06:25 PM »
ikari, the size is 8Mb! (8 388 608 bytes) 8)

Code: [Select]
  <?xml version="1.0" encoding="UTF-8" ?>
- <cartridge region="NTSC">
- <rom name="thracia776.sfc">
  <map mode="linear" address="00-7d:8000-ffff" offset="0x400000" />
  <map mode="linear" address="80-ff:8000-ffff" offset="0x000000" />
  </rom>
- <ram size="0x8000">
  <map mode="linear" address="20-3f:6000-7fff" />
  <map mode="linear" address="a0-bf:6000-7fff" />
  <map mode="linear" address="70-7f:0000-7fff" />
  </ram>
  </cartridge>

Offline redguy

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +148/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #3 on: January 21, 2018, 10:06 PM »
https://drive.google.com/file/d/1v0rqCa8RUeSsZP6qhBJ5cBNf-z8wytJB/view?usp=sharing

That link is to a new fpga_base.bit file with a very simple but not 100% complete change (for all possible types of ROMs) which fixes the problem.  Make sure you are running 0.1.7e and copy it over the existing file in the sd2snes/ subdirectory on your SD card.

It's incomplete because several games have conflicting address maps for a LOROM style map that is >4MB.  I took a look at snes9x source code and the generic behavior when it detects the header is >4MB is to stack 4-8MB and then 0-4MB.  The patched FPGA file does that with the following change in the address map for LOROM:
                            : ({2'b00, SNES_ADDR[22:16], SNES_ADDR[14:0]}
                               & ROM_MASK))
to:
                            : ({1'b0, ~SNES_ADDR[23], SNES_ADDR[22:16], SNES_ADDR[14:0]}
                               & ROM_MASK))

But there are exceptions to this like SA-1, S-DD1, and SPC7110 games.  And if the header score is lower for the 4MB region of the ROM it doesn't invert bit 23.  I don't have anything that breaks with the change, but it's possible a ROM hack or really any game that is >4MB and expects LOROM addressing will stop working.  It would have to expect the 0-4MB to be mirrored to 4-8MB for it to work with an unmodified 0.1.7e.  I also didn't touch the SaveRAM address map because the latest version of snes9x doesn't do that.  What's weird is that address map you posted does.  So you may want to test if the saving/loading works in the game.

A more complete solution would require changing the firmware to perform these checks and enable different maps.  It would be cool to have support for a programmable address map via a xml file.  :)
« Last Edit: January 23, 2018, 04:06 AM by redguy »

Offline Quirino

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #4 on: January 22, 2018, 03:21 PM »
It works like a charm with the fpga_base.bit file! Thanks a lot for the quick solution :)

Offline ikari_01

  • Sr. Member
  • ****
  • Posts: 309
  • Karma: +80/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #5 on: January 25, 2018, 05:04 PM »
That should do the trick indeed, ROM_MASK is going to take care of the redundant A23 toggling for LoROM <= 32Mbits.

Offline niggelmymiggel

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #6 on: January 25, 2018, 11:55 PM »
Hey guys do you think this would work with my super everdrive? Would love to play the english patched thracia 776 on the bvm. That's one good looking game

Offline TheShadowRunner

  • Full Member
  • ***
  • Posts: 117
  • Karma: +8/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #7 on: April 09, 2018, 08:27 PM »
redguy, do you think it'll be eventually possible to combine this custom fpga_base.bit that allows Thracia 776 to work with the fpga_base.bit required for your (absolutely awesome 8)) fpga_gsu.bit to work?

Offline iwasaperson

  • Full Member
  • ***
  • Posts: 141
  • Karma: +13/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #8 on: April 09, 2018, 11:24 PM »
redguy, do you think it'll be eventually possible to combine this custom fpga_base.bit that allows Thracia 776 to work with the fpga_base.bit required for your (absolutely awesome 8)) fpga_gsu.bit to work?
I don't see why it wouldn't work already. The fpga_base.bit file included in Redguy's GSU core is the same file as in 0.1.7e.
@Syboxez on Discord and some other places as well.

Offline TheShadowRunner

  • Full Member
  • ***
  • Posts: 117
  • Karma: +8/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #9 on: April 10, 2018, 01:08 AM »
I don't see why it wouldn't work already. The fpga_base.bit file included in Redguy's GSU core is the same file as in 0.1.7e.
Oh it is...great!

Offline butfluffy

  • Hero Member
  • *****
  • Posts: 842
  • Karma: +46/-8
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #10 on: April 10, 2018, 04:41 AM »
will this fix by redguy also become part of the official OS release along with redguy's gsu support?

Offline TheShadowRunner

  • Full Member
  • ***
  • Posts: 117
  • Karma: +8/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #11 on: April 10, 2018, 11:39 PM »
will this fix by redguy also become part of the official OS release along with redguy's gsu support?
That would be ideal. So using the fpga_base.bit from this thread with fpga_gsu.bit v5, happy to report everything works fine.
Which goes to show fpga_gsu.bit doesn't rely on the official fpga_base.bit v0.1.7e to work.
« Last Edit: April 15, 2018, 05:56 AM by TheShadowRunner »

Offline ikari_01

  • Sr. Member
  • ****
  • Posts: 309
  • Karma: +80/-0
    • View Profile
Re: My SD2SNES cannot run ExLoRom game
« Reply #12 on: April 13, 2018, 01:46 PM »
Generally speaking the bit files don't rely on each other at all. It's just important that they all use the same firmware interface that matches the firmware.img ;)