sfrom Tool

NOTICE: The work on this website is not to be distributed elsewhere or used in commercial products!

 Contents:



sfrom Tool:

This is a tool for creating .sfrom format files from normal .smc/.sfc game ROMs, for use with the SNES Classic, Switch SNES Online and 3DS VC.

This program aims to make .sfrom's as close to 100% accurate as possible, both in terms of byte values/locations and supporting PCM audio/SDA graphics.

Nintendo's canoe emulator is very picky compared to most typical emulators. It requires very specific versions of ROMs, and unique game specific settings that need to be set when the .sfrom is created. So below is a package of ".cnp" patches, a unique patch format created specifically for sfrom Tool. These patches do more than .ips patches in that they also support patching in PCM/SDA data to the .sfrom, and automatically provide the proper settings for the .sfrom in addition to patching the game ROM.


Download:
sfrom Tool - v1.3.0.1 Windows 1.08MB
Un-Official / WIP Release PageLink

Recommended Links:
hakchi2.21f (Popular among the SNESClassic's official stock emu purists/minimalists. Little BS you don't need.) Link
hakchi2 CE (Uses sfrom Tool like a library for easier .sfrom generation, at the cost of control.) Link
Robin64's Un-Offcial SFROM Tool Database Extension and Canoe Patches Link
Robin64's Moderated Canoe Compatibility List Link

Patches:

Extract the .cnp files from these archives to the "patches" folder.
The next time you run SFROM Tool they will be detected and imported.
All-in-one Packages VC&SDA / PCM (Do not use PCM patches with Switch!)


How to: (For normal hakchi2.21f use)

Before running SFROM Tool, download and install the above patches. The important package is the "VC&SDA" package. The PCM package is completely optional. I'd recommend downloading Robin64's package too.

  • 1. ) Open SFROM Tool.
  • 2. ) Select "File -> Open ROM", and select the ROM you want to use.
  • 2.5) Optional: Select "Edit -> Advanced Options". From this window you can select to apply IPS patches like translations, or select a different GameCode. Press save when done to apply changes.
  • 3. ) Select "File -> Save as ____ SFROM", and chose a name.
  • 4. ) In hakchi2 press the "Add more games" button and select the .sfrom you saved in step #3.
  • 4.5) Optional: Adjust any settings you care for, like the games displayed name or box art.
  • 5. ) Select "Synchronize selected games with NES/SNES Mini".
  • 6. ) Restart your Classic console, select the game and play!

It's that simple! You don't "have to" manually select the .cnp patches in most cases. To know if a .cnp patch is detected and being used for a game you select, the little circle in the lower right corner should be green.


FAQ:

What is a sfrom?

  • A sfrom is an official Nintendo created SNES game ROM file format introduced with the SNES Classic, and later revised on the Switch. The SNES Classic version is heavily based off a format used for the WiiU SNES Virtual Console. From what I can tell a SNES Classic .sfrom is basically the 6th version of that WiiU format. Unlike a normal SNES ROM, a sfrom contains predetermined settings for the playback of the game, along with (optional) external audio and (optional) decompressed graphics tile data. The Switch version removes the support for external audio, and simplifies the header data down into a single footer.

What is canoe?

  • Canoe is the official SNES emulator, made by Nintendo, on the SNES Classic. Its also believe to be internally used on other platforms for their Virtual Consoles SNES emulators.

Why do I need this program to make sfroms for the SNES Classic? Isn't hakchi2 (main branch) enough?

  • No. hakchi2's sfrom creation code was poorly made with a very early, flawed, incomplete understanding of the sfrom format. It was only made to work "good enough". Week #1 I investigated the sfrom format and found flaws and limitations with hakchi2s implementation, and when I brought it up with the dev I was utterly ignored. So I made this program. The accuracy of sfroms created with my tool provide a quality, and level of confidence that no issues should be encountered that are caused by a poorly made sfrom.

What are the differences with sfroms made by this, and by hakchi2 (main branch)?

  • With my program, bytes in the headers are set correctly and are in their proper locations. You can also change more of the header values than just Game Codes ("Preset IDs") and the Special Chip Byte. My program supports using the sfrom format to its fullest design by allowing you to create sfroms with PCM/SDA data. Rather then the same small number of a database of "Preset IDs" in hakchi2, I actually put in effort to compile a database of Game Codes 6-8x larger. Beyond Game Codes, my database also contains the exact settings Nintendo chose for every known officially compatible ROM. Finally, I created a custom patch format for my program to allow you to create properly compatible sfroms that are almost 100% byte-for-byte matches to what an officially Nintendo produced sfrom would look like.

Why is all this needed? Why cant I just play any game on canoe with no issues?

  • Because Nintendo took shortcuts. They didn't code canoe to emulate the hardware. They coded it to play only games from a certain list. They also chose their methods to ensure optimized playback speed, at the cost of accuracy in the form of unique game specific hacks/settings.

What is this list of officially supported games?


What is a Game Code (a.k.a., "Preset ID")?

  • It's a 2 byte long indexing value that's uniquely assigned by Nintendo to each VC/CC game. It resides in the games sfrom Info header. Each GameCode is associated with an exact "game + region + version" number, or in later Switch releases just "game + version". Using anything other then it's intended "game + region + version" with a GameCode is like trying to place a wrong piece into a puzzle. It might sort of fit/work, but there will likely be some problem. Each GameCode is believed to tell canoe to use certain code/features specifically meant for the intended game, while often disabling what it doesn't need.

Can I use any games that are not on the list or a Virtual Console with canoe?

  • Yes. But it's luck if it will work at all or with minor issues. There's a catch all GameCode (0), that while it fails to load code that games might specifically need, it doesn't load code meant for a specific game that would disrupts other games. Many games are playable with that GameCode. Some games can use GameCodes's belonging to another with minimal issues. It's kind of my hope to find what GameCodes's work best with such games. I started cataloging the known games just so people would have a basis to try just that. There are however certain games that may never work, due to lack of special chip emulation, SRAM limits, unimplemented feature support, etc. Nintendo made official ROM hacks for many of the games on the list to bypass having to properly code such stuff.

What is the difference between using the PCM audio patches and normal audio?

  • In short? Just a very small speed boost, at the trade off of small quality/accuracy loss..
  • In full? The PCM audio patches are something that Nintendo generated for the original Wii VC. It was either due to the speed boost being more significant then, or possibly due to a licensing issue since the original SPC700 audio processing hardware in the SNES console was developed by now rival Sony. It is a simple, mostly direct, decoding of the otherwise encoded BRR audio inside a game. It was never intended to be something like MSU-1 audio, and there is no quality gain using it over normal BRR audio. To be perfectly honest, there appears to be some data loss in the decoding process, so some notes and samples may sound very slightly  "off".

What do the different patch types mean?

  • VC - Canoe often, but not always, expects and requires ROM's that were only available on a Virtual Console. Sometimes it's a minor hack, sometimes its a V1.1+ that was never released on cartridge. These patches transform a normal proper dump into one of these Virtual Console ROMs.

  • PCM - Canoe supports .sfroms that contain the audio data extracted from the ROM and stored externally in a PCM format. Such ROMs were hacked with pointers replacing the original audio. So PCM .cnp patches both patch the game ROM with such pointers and provide the PCM audio for the .sfrom.

  • SDA - This seems mainly unique to S-DD1 games. Rather than properly supporting decrypting S-DD1 graphics, the tile data for the graphics is stored un-encrypted in a .sda file. And like PCM audio, the game ROM is hacked with pointers replacing all S-DD1 graphics calls.

  • Canoe Fix - Generally used with games that were never released on a Virtual Console, this type of patch typically changes something in the game ROM that otherwise prevents the game from working. This is much like VC patches, except they are non-official fan made fixes.

What do the settings on the advanced tab mean/do?

  • Product ID - This is a 8 character string that's derived from the Virtual Console the SNES Game was released on. Each release was given a Product ID that was generally used for setting folder paths for the installed VC game and it's saves. "WUP"=WiiU, and "KTR"=3DS as seen in those consoles SNES VC files. "WUP" being present in the SNES Classics official stock sfroms is because the sfrom format was based off the WiiU VC. Due to this consistency, I use "RVL"=Wii for games then were never officially assigned Product IDs on the WiiU/3DS, but had GameCodes reserved. It makes the most sense. For SNES games not released on any VC I'd use use a modified version of their original cartridge Product ID.
  • Game Code - See the above question "What is a Game Code?".
  • Volume - This was used on the VC to set the base volume for the emulator when it plays the ROM. It seems unused with canoe in favor of the --volume command line param.
  • FPS - This corresponds to the frame rate that a game was meant to run at. Officially 60 for NTSC games, and 50 for PAL games. No known other values were used. This however does not seem to effect games on the SNES Classic, as setting PAL games to 50 still has them run fast.
  • Max Input - This controls how many controllers are actively checked by canoe for valid input. You could have 2 controllers hooked up, but if the value is set to 1, then the 2nd controller is ignored.
  • ROM Map - This is believed to be intended as an override to force the emulator to detect a ROM as a Lo/HiROM instead of figuring it out for itself. While this byte wasn't present in early WiiU VC releases, proving the emulator code doesn't need it, it has been present in later releases, and seems to be required for the SNESC.
  • Special Chip - This is a byte that was intended for all special chips, the byte being reserved in early WiiU VC releases when special chip games started being added. But this went unused until the SNES Classic for whatever reason. Likely that the GameCode did well enough at enabling emulation of such special hardware. Its only official use is with Super FX games..
  • Para - The complete purpose of this value is unknown. But it appear to be a 4 byte value (probably an Integer) that is always set to 1 except for 7 known cases where it is set to 0. In early versions of the sfrom format this was always set to 0. In 3DS VC files, the byte is set to 3 and sometimes 2. On the WiiU its full name is "WiiU Para", and thus on 3DS its probably "3DS Para". I believe its probably just a version ID, or compatibility mode value thats now unused.
  • Max Speed - The complete purpose of this value is unknown. It is always set to 1. In early versions of the sfrom format this was always set to 0. Based on the name though, I believe its a emulation speed limiter. It is unused on the SNES Classic.

Where do some of these terms and formats come from? What do they mean?

  • SDA - When researching the various VC's, the original Wii VC SFA2 included files with an ".sda" extension. The contents of this file are exactly the same as the data at the end of the WiiU VC/3DS VC versions of the same games. So I adopted that extension to keep my tool consistent.
  • PCM/VAR - Like SDA, the original Wii VC files contain .pcm and .var files that are 100% matches for the content seen in the WiiU/3DS VC files.
  • WUP/KTR/RVL, etc - These are official 3 character abbreviations of the systems production code name that are used in Product IDs.
  • -JXXY - The other half of the Product ID's, the first J means "SNES", as opposed to any other console on the VC. The XX is the 2 character ID that's unique to that game. The Y is the region character, generally E (US), J (Japan), and P (Europe). D (Gemany), and F (France) were also used on the VC's. I chose to use the product ID formats as the naming convention for these patches, as to me it made the most sense.
  • VC - Virtual Console.
  • CC - Classic Console (I.E. SNES Classic, NES Classic, etc)