##### SGB notes by Redacted173, adapted for the current firmware release #####

SD2SNES SGB2
============
The SD2SNES SGB firmware adds Super Game Boy 2 support to the SD2SNES Classic and SD2SNES Pro.  SGB support allows you to play Game Boy games on your SNES directly from the SD2SNES menu.

Current firmware release: v1.11.0b1
SGB version level: sgb07

Setup
-----

1) Obtain a copy of the SGB2 boot ROM, sgb2_boot.bin, and SGB2 SNES ROM.  Rename the SNES ROM to sgb2_snes.bin and copy both files to the sd2snes/ directory on the SD card.

  a) sgb2_boot.bin
     COMMENT:       Look for a file with this same name
     SIZE:          256B
     SHA-1:         93407EA10D2F30AB96A314D8ECA44FE160AEA734
     MD5SUM:        E0430BCA9925FB9882148FD2DC2418C1
     CRC32:         53D0DD63

  b) sgb2_snes.bin
     COMMENT:       Super Game Boy 2 (Japan).sfc is one possible name
     SIZE:          512KB
     SHA-1:         E5B2922CA137051059E4269B236D07A22C07BC84
     MD5SUM:        8ECD73EB4EDF7ED7E81AEF1BE80031D5
     CRC32:         CB176E45 (snes9x displays this at start)
     SNES HDR CSUM: 7DD5

  NOTE: It's only necessary to check one of the hashes above for each file.  For example, if CRC32 matches in snes9x when running sgb2_snes.bin it's not necessary to check SHA-1, MD5SUM, or the SNES header checksum.

2) Confirm that everything is installed correctly by checking the "System Information" menu.

  a) Start up the SD2SNES and go to "System Information": [Press X]->Select (System Information) [Press A]

  b) Verify "sgb2_boot.bin/sgb2_snes.bin: ok" is displayed near the bottom of "System Information" screen.
     - "checking" : waiting for the SD acc. time test to complete.
     - "missing"  : one or both of the sgb2_boot.bin and sgb2_snes.bin files are missing.
     - "mismatch" : both files are present but one or both do not match the expected files.  This may lead to problems when running GB games.
     - "ok"       : both files are present and they match the expected files.

Make sure cartridge audio is enabled and volume is at a reasonable level if you are not using an original SNES.  Add GB games with extension ".gb" to the SD card.  They should now be visible in the menu with the SGB firmware installed.  Some Game Boy Color games with extension ".gbc" also work on the original Game Boy and therefore will work on the SGB.  

RTC
---
A real time clock (RTC) is available for the small set of games that have one in the cartridge and use the MBC3 mapper.  Examples of these games include Pokemon Gold and Silver.  It relies on a working SD2SNES real-time clock so before starting the game for the first time the menu clock must be set accurately and maintain time even after powering off.  This requires a working battery.

If you have tried one of these games prior to version 03 then delete the following files on the SD card:

  /sd2snes/saves/<game_file_name>.gtc
  /sd2snes/saves/<game_file_name>.srm

Checklist for working RTC:
- SD2SNES menu clock is set correctly and works even after powering off the console.
- Remove the two files in /sd2snes/saves listed above before starting a new save in the game.  This should only be done once after upgrading to SGB version 03 or later.
- New game save is started after SGB version 03.  Using a save (SRM) from another source (e.g. software emulator) will not set the time in game properly.

Notes
-----
- Additional configuration options are available in config.yml.  Newly added options will only show up in config.yml after first booting the SD2SNES with the latest firmware.
- Audio volume boosting has been added to compensate for different revisions of the SD2SNES.  If you have an unmodified SD2SNES RevF try value 3.  SD2SNES Pro should use the default value 0.  See config.yml to enable.
- Save states are available for development.  They are mapped to: Save=X+R, Load=X+L.  See config.yml to enable.  (SGB) in-game hooks must be enabled.  See (4d) above.  Save states will not work with all games.  They are not supported on SD2SNES classic when MSU audio is used due to space.
- For games that load a full background the top scanline may flash on certain SNES console revisions.  Enabling "1CHIP transient fixes" in the SD2SNES Configuration menu may help to reduce or eliminate the flashing.  It will not affect the flashing in other scanlines.  Other SNES games may not work with this feature enabled.
- Cartridge memory (save game data) writing to SD works.  Some games use CartRAM as a scratch pad so your SD2SNES's red light may remain on during game play.  This signifies periodic saving.  In this situation hold down the reset button on the SNES several seconds before powering it down to ensure the latest CartRAM is saved to the SD card.
- In-Game Hooks/Buttons are supported only with the expected sgb2_boot.bin and sgb2_snes.bin files.  Hooks will not work with all games (e.g. Space Invaders Arcade).
- The serial link is not supported.
- MSU audio support is present on both SD2SNES Classic and FXPAK Pro.  The SD2SNES Classic does not include MSU data support due to space.
- Memory Bank Controllers (MBC) 0,1,1M,2,3 are implemented.  These are the most common mappers.  Basic support for HUC1, HUC3, MBC5, and the GB Camera has also been added, but peripheral devices (RTC, IR, Camera, etc) do not work for these mappers.  This only allows the game to start without crashing.  All other mappers will not work.
- SNES cheats (yaml file) are not available when playing GB games.
- The sgb2_snes.bin file must:
  - be in LOROM format
  - be less than or equal to 512KB
  - not use SNES Cart RAM.  Note, this is different than GB Cart RAM.
  The file listed in setup step (3b) meets these requirements.

Version History
---------------
See: https://github.com/redacted173/sd2snes/releases
