Retrode 2 Firmware Files

Retrode 1 Firmware Files

Retrode Firmware
(C) 2009-2014, Matthias Hullin
[matthias at retrode dot org]
(C) 2012, Muzer
(C) 2013-2017, Wannado
All rights reserved.

Make sure you are using the right firmware version
for your device (Retrode1 vs. Retrode2). Please see
http://www.retrode.org/firmware for updating
instructions.

This software uses the LUFA library by Dean Camera.
Learn more at http://www.fourwalledcubicle.com/LUFA.php

The authors disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness.  In no event shall the authors be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.

Release history
v0.25a (2018-08-17)
- Changes by skaman:
-- SEGA Genesis/Megadrive Fix for Sonic 3 & Knuckles.
   The v0.24a code changes to support Super Street Fighter 2
   broke the support for Sonic 3 & Knuckles.

v0.25 (2018-05-12)
- Changes by skaman:
-- Virtual Boy Saves!
-- Added VB SRAM save support.
-- VB SRAM carts should be identified by Product Code
   and display the .SAV file.  The .SAV file can be read
   and written.
-- SRAM support requires a modified VB Plugin with the SRAM
   control pins connected.
-- Fixed identification of Red Alarm.
-- Fixed Galactic Pinball and Mario's Tennis detection.
-- Moved VBOY cart detection ahead of NGP cart detection.
   Some VBOY carts were incorrectly detected as NGP.
-- Added "vboy" setting for [forceSystem] in the Config file.
-- Fixed VBOY size detection code to work with [forceSystem].

v0.24a (2018-05-12)
- Changes by skaman:
-- SEGA SMS and GG Fixes!
-- DISABLED SNES NINTENDO POWER FLASH MAP FILE DISPLAY
   DUE TO v0.24 BUG PREVENTING MULTI-GAME SWITCHING.
   THIS BUG EXISTS ONLY IN THE FW v0.24 RELEASE.
   USE FW v0.22, v0.23, OR v0.23a TO SEE THE FLASH MAP FILES.
-- Added Sega Genesis/Megadrive Super Street Fighter 2 
   detection and mapping.
-- Added Sega XBAND Modem detection and SRAM save support.
-- Added SNES XBAND Modem detection and SRAM save support.
   NOTE:  To read the XBAND ROM and SRAM, the switch on the
   unit must be in the bottom position.  A cart does NOT
   need to be attached to read the XBAND ROM and SRAM.

v0.24 (2018-03-14)
- Changes by skaman:
-- SEGA SMS and GG Saves!
-- Fixed SMS SRAM read support.
-- Added SMS SRAM write support.
-- SMS SRAM carts should be identified by Product Code
   and display the .SAV file.  The .SAV file can be read
   and written.
-- Corrected the ROM size identification for Mega, 
   Two-Mega, and Four-Mega carts.
-- Fixed Product Code identification.
-- Fixed identification of SMS Monopoly (U) to output
   the proper ROM and SRAM save file.
-- Fixed identification of SMS Wonder Boy in Monster
   World (EK) and SMS New Zealand Story (E) to output the
   proper ROM file.
-- Added code to improve handing carts with bad headers.
   A small number of games will still require using the 
   [forceSystem] setting in the Config file due to
   missing ASCII text at the start of the header.
-- Added identification of SMS Ys (J) save file.
-- Added identification of SMS Haja no Fuuin (J) save file.
-- Added GG SRAM save support.
-- GG SRAM carts should be identified by Product Code
   and display the .SAV file.  The .SAV file can be read
   and written.
-- Added GG EEPROM save support.
-- GG EEPROM carts should be identified by Product Code
   and display the .SAV file.  The .SAV file can be read
   and written.
-- Corrected GG Nomo's World Series Baseball from EEPROM
   to SRAM.  The cart uses the BR6265 SRAM chip with 
   battery.
-- Removed GG Pro Yakyuu GG League '94 from EEPROM list.
-- Added identification of GG Pro Yakyuu '91 (J).
-- Fixed GG ROM size "0" identification.  ROM size "0" 
   is 256KB, however, carts may be 256KB, 512KB, or 1MB.
-- Fixed SMS Codemasters cart detection.
-- Added GG Codemasters cart support.
-- WARNING:  Codemasters carts require modification of the
   SMS/GG Plugin.  The CLOCK connection must be made from
   both slots to the plugin edge (pin B9).  In addition, 
   SMS Codemasters carts require the /MREQ pin to be 
   connected to the /CE pin.
-- Moved SMS/GG cart detection ahead of NGP cart detection.
   Some SMS carts were incorrectly detected as NGP.
-- Changed the SMS/GG SRAM save extension to ".SAV".
   This appears to be the extension expected by most
   SEGA emulators.
-- Added identification of Genesis/Megadrive carts with
   missing SRAM save data in the header.
-- Fixed Genesis/Megadrive SRAM code.  Fixes Phantasy
   Star IV and other large SRAM (16KB or larger) saves.

v0.23a (2018-01-10)
- Changes by skaman:
-- N64 Fixes!
-- Fixed the ROM size for N64 Command & Conquer.
   The C&C ROM is padded out with 14MB of 00s at the end
   which breaks the cart heuristics.
-- Added Rockman Dash (J) to the N64 FlashRAM list.

v0.23 (2017-11-03)
- Changes by skaman:
-- N64 Saves!
-- Added N64 SRAM save support.
-- N64 SRAM carts should be identified by Cart ID and
   display the .SRA file.  The .SRA file can be read
   and written.
-- Added proper Dezaemon 3D 768Kbit SRAM support.
-- Added identification of the Hoshi no Kirby 64 (J) 
   savetype based on the ROM version.  v1.0 & v1.1 are 
   SRAM,  1.2 & v1.3 are EEPROM4K.
-- Added N64 FlashRAM save support.
-- N64 FlashRAM carts should be identified by Cart ID
   and display the .FLA file.  The .FLA file can be read
   and written.
-- WARNING:  FlashRAM writes take time to complete as 
   the chip must first be erased before writing to it.
   ** WHEN SAVING AN UPDATED .FLA FILE, DO NOT RESET **
   **** OR UNPLUG THE RETRODE WHILE THE LED IS ON! ****
-- Added N64 EEPROM save support.
-- N64 EEPROM carts should be identified by Cart ID and
   display the .EEP file.  The .EEP file can be read
   and written.
-- WARNING:  EEPROM16K writes take time to complete.
   ** WHEN SAVING AN UPDATED .EEP FILE, DO NOT RESET **
   **** OR UNPLUG THE RETRODE WHILE THE LED IS ON! ****
-- Added reading of the N64 Gameshark.  When a working
   Gameshark is attached, the Gameshark.z64 ROM will be
   displayed.
-- Fixed the N64 heuristics code to recognize 20MB and
   40MB games.  These were previously overlooked by the
   code.  Fixes Donald Duck Goin' Quackers, Paper Mario,
   and Ogre Battle 64.
-- Fixed the N64 heuristics code for underdumps of Body
   Harvest and Paper Mario (E).  Modified the addresses
   checked to determine the cart size.
-- Modified the Config file to change the save file 
   write protection setting from "[sramReadonly]" to
   "[saveReadonly]".  The change was made since the 
   same setting is applied to all save types including
   SRAM, FlashRAM, and Controller Pak save files.
-- Modified the Config file's default N64 ROM extension
   to ".z64".  This is the correct extension for the 
   native big endian format output by the Retrode.
-- WARNING:  THERE IS NO SUPPORT FOR REPRODUCTION N64
   CARTS.  MOST REPRODUCTION CARTS WILL HAVE CART 
   RECOGNITION PROBLEMS AND/OR SAVE PROBLEMS.  YMMV.

v0.22 (2017-08-18)
- Changes by skaman:
-- SNES Enhancements!
-- Added support for SNES Enhanced Chip carts:
   CX4, SDD1, ExHiROM, SPC7110, SA-1, BS Satellaview,
   Sufami Turbo, 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.
-- Added display of Nintendo Power flash mapping.  Press
   the HWB button to cycle thru games.  The flash map
   files will be shown when the base ROM is displayed
   for the 2nd time.  Flash map files are read only.
-- Added support for BS Satellaview carts and memory paks.
   Memory Pak support is limited to read only on the BS-X,
   Special LoROM, and HiROM carts.
-- WARNING:  Memory Paks will not work on the SA-1 carts.
-- WARNING:  Completely blank (all 0xFFs) Memory Paks
   will not be shown when inserted in the BS-X cart.
-- Added support for the Sufami Turbo adapter and carts.
   Carts will have the adapter slot position (A or B)
   added to the filename. This allows two carts with the
   same name to be accessed.
-- Added reading of Flash saves for the JRA PAT/SPAT4 carts.
   These carts use a 1024Kb Flash chip with unique mapping.
-- Fixed HiROM to read ROM starting from Bank 0xC0.
   Previous code used the mirror in lower banks which
   returned incomplete data.
-- Fixed LoROM to read ROM starting from Bank 0x80 for
   large (> 24 Mbit) games.
-- 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.
-- Fixed SuperFX SRAM bug where the upper half of the 64K
   SRAM size was mapped to the wrong bank.  SuperFX SRAM
   starts in Bank 0x70 and bankswitches at 0x10000 bytes.
-- 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.
-- Added Config file option to control SNES automatic
   overdump correction. Default setting is 1 = ON.
-- Added Config file option to display the ROM Version in
   place of the checksum.  Default setting is 0 = OFF.

v0.21 beta (2017-01-21)
- Changes by Wannado:
-- Another attempt to get MD SRAM size detection right.
   This includes changing the hard-coded parameters for
   "Sonic 3 & Knuckles" (to 512 bytes, lower byte mode).
   For other games, if the SRAM parameters do not meet
   the conditions that the firmware's code relies on, then
   no SRAM file will be created.
-- To select the format of the MD SRAM file, the following
   values are now allowed for [segaSram16bit]:
   0 = 8 bits per word address if that's useful according
       to the game's header/SRAM mode; 16 bits otherwise.
       (Changed to take the SRAM mode into account.)
   1 = Always 16 bits per word address.
   2 = Always 16 bits, file bloated to 64 kiB. (New.)
   Note: This setting does not override the detected SRAM
   size or mode. It only causes the SRAM file to be padded
   as necessary for the selected format.
-- Slightly changed MD ROM size detection, hopefully
   improving it: Previously, if the game's header indicated
   64 Mbits, the value was rejected, and 32 Mbits was used
   instead. Now 64 Mbits is accepted, too.
-- Two more games are now recognized by their header
   checksums to prevent overdumping:
   SNES: 9F27: ALL_STARS + WORLD (US)
   MD:   95C9: Zero Wing (EU, at least)
-- Minor internal changes that should not affect behavior.

v0.20 beta (2016-09-09)
- This release is provided in two variants:
  "...-v0.20-beta.hex" was built as usual.
  "...-v0.20-beta-log.hex" has the logfile enabled. This
  is intended for analysis of particular issues only, as
  it degrades performance and might cause timing issues.
- Changes by Wannado:
-- Raised the maximum forceable size for SMS and GG games
   to 8 Mbits (overdump level 4 or [forceSize] 8).
-- Added support for GB SRAM sizes 64 kiB and 128 kiB.
   This will hopefully enable access to GB Camera saves.
-- Removed arbitrary limit that prevented writing SRAM
   beyond 32 kiB.
-- Attempt to fix suspected bug in MD SRAM size detection.

v0.19 beta (2016-05-01)
- Changed extension of GB saves to .sav as suggested
  by justin89.
- Changes by Wannado:
-- Added SRAM access for GB games with MBC2 chip.
-- Fixed a bug that caused SRAM corruption on GB games
   (e. g. Link's Awakening: offset 1EFF was set to 0).
-- Filesystem: The second boot sector now also has the
   signature bytes 55 AA.
   Might this improve compatibility with Android?
-- Fixed a bug that could have caused auto-detection of
   a cartridge in the SNES slot to freeze in rare cases.
-- The [forceSystem] values SNES, A26, NGP2 and TG16 apply
   to the SNES slot only, and the values MDRV, NGP, SMS,
   GG, N64, GBA and GBOY apply to the SEGA slot only.
   Auto-detection is now enabled for the opposite slot
   in each case. The value AUTO enables it for both slots.
   Note: All [forceSystem] values are case-insensitive.
-- Setting [forceSystem] to an unrecognized value now
   disables auto-detection. The Retrode then presents an
   empty file named "forceSystem invalid.".
-- If [forceSystem] is A26, [forceMapper] now accepts the
   values 0 to 10, where 0=no mapper, 1=F8, 2=F6, 3=FA,
   4=FE, 5=E0, 6=E7, 7=F4, 8=3F 9=F0* 10=UA.
   *Support for mapper F0 is not implemented yet.
-- Support for N64 controllers now requires that either
   no cartridge or solely an N64 cartridge is connected.
   That means, if you added controller ports to your old
   N64/GBx combo plug-in, using the controllers while a 
   GBA game is connected is no longer possible.
   This is to avoid possible conflicts during detection
   and later operation. A deeper analysis of the issues
   may allow to relax this restriction in a future release.
-- Unified two nearly identical blocks of code in N64 size
   detection, hopefully achieving the same or better
   results in practice.
-- If the configuration was last written using a v0.18
   release, all settings will be kept.
-- Some internal improvements.
-- More clean-up.

v0.18d beta 3 (2015-11-15)
- Changes by Wannado:
-- Major changes in the file system implementation to
   simplify future development.
-- Streamlined initialization sequence.
-- Fixed "[forceSystem] GG" config setting not being
   recognized.
- Fixed the condition for SMS SRAM detection. Thanks to
  user justin89 for contributing this fix.
  Note that the whole SMS SRAM feature is still untested.

v0.18d beta 2 (2014-01-22)
- Fixed writing of GB saves larger than 8 kbytes.

v0.18d beta (2013-12-05)
- Writing of GB saves (may need renaming .srm to .sav
  before starting some emulators like VisualBoyAdvance)
- Access to N64 Memory Paks courtesy of Wannado (not
  all emulators support this)
- Fixed SMS SRAM cluster bug found by Wannado - thanks!
- Minor improvements and thorough testing of recently
  added features

v0.18c (2013-04-26)
- When using HWB overdumping for N64 or GBA titles,
  or when autodetection fails and default size is used,
  file name tells us so (instead of 4-digit game code).
- Adapted min and max GBA sizes by forum user input.
- Huge improvement to GBA size detection, small
  improvement to N64 (should fix BM64 and OoT)
- Updated LUFA library to latest version 130303.
- Fixed bug that caused crash using SMS plug-in.
- Added SMS SRAM reading (untested!)
- Added config option [blinkControllers]

v0.18b (2012-08-08)
- Atari 2600 changes:
-- Timing changed to increase compatibility
   (especially with first-party Atari games).
-- Bankswitching detection improved (fixes many F6
   games among others). Please report any regressions.
-- A bug that could cause accidental bankswitching
   during dumping (and therefore corrupt dumps) in some
   games has been fixed (fixes "Dig Dug")
- Turbografx-16 changes:
-- Implemented support for PC Engine games. Detection
   is very experimental as there is no easy way to do
   it, so it uses frequencies of 6502 opcodes. However,
   you can force detection by setting forceSystem to
   "TG16" and forceMapper to a number other than 0.
   This support is untested and so experimental. Please
   report any games that don't work or aren't detected.
- Added a feature that flashes the LED rapidly three
  times when the overdump button is pressed to return
  to automatic detection mode.

v0.18a (2012-05-09)
- N64 controller support: Connect data line via 220ohm
  resistor to Sega slot pins A7 (controller #1) and
  A5 (#2).
- Startup HIDMode setting: Hold down D-pad to choose
  values 0 (up), 1 (up+left), 2 (left), 3 (down+left),
  4 (down). Also press Start to make the setting
  permanent
- HID joystick (HIDMode 1, 2) now reports 16 buttons
- KB Mode ([HIDMode] 3) now supports 4 players
- A dedicated USB PID per HIDMode setting, for
  smoother enumeration, and driver handling by OS
- Streamlined config file (no more key mappings, file
  extensions for plug-in prototypes)
- Added config options for SMS and GG rom extensions
- Fixed overdump mode (HWB button)
- Firmware checks major version and re-initializes
  config settings if incompatible

v0.17g (2012-04-17)
- LED now lights up on controller activity
- Cartridge re-detection now timer-based (for constant
  timing in different HID modes)
- Experimental SRAM bankswitch for Phantasy Star IV.
  (Anyone care to test SRAM for that game?)
- Sonic 3 SRAM bank switching bugfix
- Minor tweak to SNES mouse acceleration profile

v0.17f (2012-03-19)
- Essential fix for SNES controllers ("B Button
  Problem" and others)
- Bugfix SRAM writing: didn't check against total size

v0.17e (2012-02-14)
- Happy Valentine's Day!
- Enabled SRAM for Sonic3 & Knuckles (anyone care to
  test?)
- In case of missing game title, use "No Name"

v0.17d (2012-02-02)
- Complete re-write of USB HID descriptors, with five
  HID configurations:
  Off (fastest), 4 Joy + Mouse, 2 Joy, KB, Arcade
- Skipped the silly "Ataliri" for 2600'er Cartridges
- Sega SRAM now 16-bit by default; significant
  improvements in detection, reading and writing
- Lowered USB current request to 100mA (was 200mA)

v0.17c (2012-01-19)
- Version number now displayed in config file
- Sonic&Knuckles lock-on technology bug fixed
  (Retrode 2 or Retrode 1 w/ S&K fix)
- Config option for Sega SRAM "16-bit mode" (some
  emulators access SRAM in bytes, some in words)
  (Retrode 2 only)

v0.17b (2011-11-24)
- Major bugfix (affected Sega 6-button controllers)
  and improvement of controller handling in general
- Re-introduced SMS/GG support

v0.17a (2011-11-12)
- Deactivated SMS support (unknown bug caused
  Retrode to crash)

v0.17  (2011-11-10)
- Support for NGP plug-ins by ponrev and
  Matthias Hullin
- Support for SMS/GG plug-in (unique filename via
  product ID. Header contains no title string)
- Support for MBC3 and MBC5 controllers on GB carts
  (requires revised plug-in hardware)
- Support for SRAM on GB carts via plug-in
- Size detection for N64 and GBA games improved
- Read and write Genesis/Mega Drive SRAM (Retrode 2
  only)
- Auto-detection for 3- and 6-button SEGA controllers
  (Retrode 2 only)
- "Force" config options for undetectable combinations
  of system, size, mappers.

v0.16a (2011-03-20)
- SRAM protection (SRAM contents were occasionally
  lost when hot-plugging cartridges)
- Preparations for future hardware revisions
- Re-activated LED
- Added overdump button (HWB button cycles between auto
  size detection and 3 predefined ROM sizes. Setting is
  temporary and reverted to auto-detect upon device reset)

v0.15u (2010-09-11)
- fix 8Mbit and 16Mbit GB ROMs, affects some Pokemons
  and Wario Land 2.

v0.15t (2010-09-01)
- fix N64 size detection? (affects Ocarina of Time)
- fix GBA size detection? (affects Mario Kart Advance)
- default GBA size to 8 megs

v0.15s (2010-08-15)
- fix GBC size detection (added some more delay for ROM
  reading)

v0.15r (2010-07-20)
- apparently, something SEGA related was broken along the
  way. Fixed.

v0.15p (2010-07-16)
- SRAM/cfg writing fixed? (Update, 9/11/2010: Apparently
  not. Sigh.)
- More reliable detection of SEGA games

v0.15n (2010-06-20)
- Using new EEPROM update functions (compare-before-write);
  extends lifetime of cfg memory

v0.15l (2010-05-23)
- Basic GB Memory Mapping works

v0.15k2 (2010-05-23)
- Tidy unified detection routine. It was about time with
  all the new adapters

v0.15k (2010-05-23)
- GBA implemented

v0.15i (2010-05-18)
- TG-16 detection

v0.15h (2010-05-14)
- improved cart detection
- USB HID disabled by default

v0.15e (2010-04-24)
- New cluster-sector system (128MB of total virtual space
  on device)

v0.15b (2010-04-24)
- SNES Mouse support on controller port 1. Use only on
  200x200 pixel displays :)