Retrode Community Forum

General Category => General Discussion => Topic started by: skaman on 11/May/2017 08:57:05 PM

Title: SNES Enhanced Cart Support (BETA)
Post by: skaman on 11/May/2017 08:57:05 PM
Matthias kindly provided me with access to the Retrode source code and I've implemented support for a majority of the SNES Enhanced Carts: CX4, SDD1, ExHiROM, SPC7110, SA-1, and Nintendo Power (SF Memory Cassette).  I've also include various fixes for other SNES issues.

My code changes have been committed but not officially reviewed and merged into the main firmware yet.  Wannado is working on other changes so hopefully there will be an official release with everything included.

The firmware supports the SPC7110, SA-1 (Read Only), and Nintendo Power carts ONLY with my Enhanced cart adapter.  The Enhanced cart adapter serves as a pass-thru that provides the signals needed for these carts to work properly with the Retrode.  My prototype adapters are working perfectly with these carts.  The final adapter design is under review.  I won't be able to test the final design until sometime next month.  More details on the adapter are forthcoming.

I want to gauge interest in the SNES Enhanced firmware and ask for BETA testers.  My code has only been compiled and tested on a Retrode 2 so the initial testers should have this hardware version.  If you're willing to test AND provide feedback, then please contact me by PM.

Keep in mind that the full functionality of this firmware is only possible with the Enhanced cart adapter.

Here's a summary of the firmware changes:
Code: [Select]
v0.22 beta (2017-05-10)
- Changes by skaman:
-- SNES Enhancements!
-- Added support for SNES Enhanced Chip carts: 
   CX4, SDD1, ExHiROM, SPC7110, SA-1, and Nintendo Power
   carts.
-- Added register writing code to enable remapping for
   CX4, SDD1, SPC7110, SA-1, and Nintendo Power carts.
-- SPC7110, SA-1 and Nintendo Power carts need a separate
   SNES Enhanced cart adapter.
-- WARNING:  SA-1 SRAM writes are not possible with the
   current hardware.  Any changes made to the SA-1 SRAM
   file on the Retrode will not be written to the cart.
-- Added Nintendo Power (SF Memory Cassette) cart support
   using the SNES Enhanced cart adapter.  The base ROM
   is initially read whether a single game or the
   multi-game Menu.  In single game mode, the SRAM is
   visible if used.
-- Added Nintendo Power multi-game switching using the
   HWB button.  Press the HWB button to switch games on
   a multi-game cart.  Refresh the Retrode folder to
   access the new game.
-- Fixed HiROM to read ROM starting from Bank 0xC0.
   Previous code used the mirror in lower banks which
   returned incomplete data.
-- Fixed HiROM SRAM to read Bank 0x30.  Previous code was
   reading Bank 0x20.  Fixes problems with Brain Lord,
   The 7th Saga, etc.
-- Fixed SRAM bank switching for both LoROM and HiROM.
   LoROM SRAM switches banks every 0x8000 bytes and HiROM
   SRAM switches banks every 0x2000 bytes.
-- Fixed SRAM size for ST010/011/018 carts.  Only ST018
   (Hayazashi Nidan Morita Shougi 2) contains SRAM.
-- Fixed SRAM bug where previous code reported size 0
   for 64K due to sramSize256 overflowing the SRAM
   setDirEntry.
-- Changed the checksum to use the proper bytes at 0xFFDE
   and 0xFFDF.  Previous code used the complement at 0xFFDC
   and 0xFFDD.
-- Added checksum + complement checksum code to check for
   the presence of ExHiROM.
-- Added code to address the incorrect mapping due to the
   too long internal ROM name (22 characters) that runs
   into 0xFFD5.  Fixes problems with Contra 3 (U),
   Krusty's Super Funhouse (U)(1.0), etc.
-- Added overdump correction code to eliminate the need to
   flag individual carts.  Removed the short internal list
   of overdumped carts since it is no longer needed.
-- Removed the HWB button overdump code since it is no
   longer necessary.  The HWB button function is now used
   for switching games on the Nintendo Power carts.
Title: Re: SNES Enhanced Cart Support (BETA)
Post by: guy on 16/May/2017 01:24:48 AM
Fantastic news! It would be great to be able to play Super Mario RPG and Kirby again.

Thank you for working on this :)
Title: Re: SNES Enhanced Cart Support (BETA)
Post by: Knight of Time on 18/May/2017 11:01:50 PM
Hey, this is looking quite promising, anyway, I have a few questions:

First of all, will this eventually have support for games that utilize the Super FX chip (e.g. Yoshi's Island)?  Second, will it be theoretically possible in the future for this add-on to write new saves to games with a special chip?  Third, will this add-on be available to buy on dragonbox?  Lastly, how much will it cost in USD/CAD (the latter is what I'm following since I'm a Canadian)?

Nice work so far.
Title: Re: SNES Enhanced Cart Support (BETA)
Post by: skaman on 19/May/2017 01:20:57 PM
Thanks for all of the interest!  I'm traveling at the moment but I will get the Beta out to the testers next week.  Wannado gave me the ok to release the initial firmware to the beta testers.  If all goes well in the testing, then I'll post the Retrode 2 firmware.  After the Retrode 2 release, I'll compile a version for the original Retrode version and ask for testers for it.

To answer Knight of Time:
SuperFX games are already supported by the Retrode firmware.  The SuperFX (and DSP) games don't do anything special in regards to accessing the ROM and SRAM.  I fixed some of the SRAM code so if it wasn't working before then test this beta to see if it fixes it.  I tested a couple of SuperFX carts including Yoshi's Island.

Writing save games for special chip carts should work with the exception of the SA-1 carts.  I added the register code for SPC7110 saves and that works (with the Enhanced cart adapter).  Reading SA-1 saves works with the Enhanced cart adapter but the Retrode is missing a couple of the pins needed to control writes to the SRAM (at least in the method that I use).  The SA-1 uses BW-RAM and I was only able to write to it with register writes that expose a section of SRAM at a time.  If you really need to write SA-1 save games, then you'll need to look into the Arduino cart reader (on which most of my code was developed).  I'm going to continue to test workarounds for the SA-1 SRAM problem but I can't say that it will ever happen due to the missing hardware.

Dragonbox is aware of the Enhanced cart adapter.  I can't speak for them but I would think it might be something that they'd want to offer.  They're currently working on a new production run of the Retrode so maybe it will become available after that.  My prototypes are small PCBs with a full length cart connector.  I'm not sure how the process to make a shell for it would go.  I'm using a hand cut universal SNES case to house one of my adapters and I ran into some clearance issues (fixing it in the next run of proto PCBs).  Hopefully, Matthias will find some time in his busy schedule to review my hardware files and work his magic on it to get ready for production.

Hope this helps!
Title: Re: SNES Enhanced Cart Support (BETA)
Post by: MasterOfPuppets on 20/May/2017 01:39:36 AM
This is a great update, thank you for all your hard work!

Would it be possible to add Satellaview dumping (no writing!) with this info?

https://wiki.superfamicom.org/snes/show/Satellaview+%28Meta%29
Title: Re: SNES Enhanced Cart Support (BETA)
Post by: skaman on 20/May/2017 04:17:13 AM
I didn't test the BS carts extensively other than to confirm the SRAM code changes fixed the large SRAM on RPG Tsukuru 2 and Sound Novel Tsukuru.  BS Satellaview carts themselves are possible to dump (SA-1 versions with the Enhanced cart adapter) but the Memory Paks are a different story as they use pins that are unavailable on the Retrode (at least the method that I use).  I'll look into workarounds for reading the BS Memory Paks.

I implemented full BS cart support with the Arduino cart reader.  LuigiBlood posted a video on YouTube not too long ago of BS dumping using the Arduino reader.  If you need to read and write Memory Paks, then you might want to look into that.
Title: Re: SNES Enhanced Cart Support (BETA)
Post by: MasterOfPuppets on 20/May/2017 08:38:06 PM
I'll look into workarounds for reading the BS Memory Paks.

Awesome, thanks!

I implemented full BS cart support with the Arduino cart reader.  LuigiBlood posted a video on YouTube not too long ago of BS dumping using the Arduino reader.  If you need to read and write Memory Paks, then you might want to look into that.

I will have to look into this, thanks for the info!