Skip to content

Instantly share code, notes, and snippets.

@DanTheMan827
Created October 9, 2017 17:22
Show Gist options
  • Save DanTheMan827/afa6193f7368b36cd1e3985d82097ce2 to your computer and use it in GitHub Desktop.
Save DanTheMan827/afa6193f7368b36cd1e3985d82097ce2 to your computer and use it in GitHub Desktop.
[NOT NOOB FRIENDLY] How to dual-boot the NES Classic and SNES Classic systems on your new SNESC

This guide was originally posted by /r/TeamZebra but has since been deleted.

The original post was located at https://www.reddit.com/r/miniSNESmods/comments/74trqo/not_noob_friendly_how_to_dualboot_the_nes_classic/


So I've been tinkering for the last day or two and I've finally gotten my SNES Classic to be a "dual-boot" sort of system, housing both the SNES Classic and NES Classic menus/ROMsets. This guide will walk you through being able to do the same, and at the end, you will have the official NES Classic emulator, ROMs, menu, screen filters, etc. loaded onto your SNES Classic. There will be a menu item in your SNES Classic called "Switch to NES Classic", and there will be a similar one to switch back to SNESC in the NESC menu. Both systems have full menu support, save state support, etc.

NOTE: This guide is NOT for the faint of heart / non-technical, and you will need to be able to use a hex editor, be comfortable with FTP, and know how to revert your console back to stock if you mess everything up :) I will not be providing help for this if you don't know what you're doing, nor am I responsible for bricks, etc. However, it should be more or less impossible to permanently brick, I'm not doing anything more unsafe than what hakchi already does, and this can all be reverted through hakchi through uninstall + flash original kernel.

NOTE 2: This guide also assumes that your SNES Classic is already running a custom kernel and flashed with hakchi2 / you already have the ability to add new games. I am NOT walking you through that portion of the process.

Caveats: As far as I know, the only current bugs are that, if you're playing NES games in the NESC menu, the physical reset button on the console causes a C7 error and you can't save the state. However, using the controller button combo for reset created by Hakchi2 (mine is select + down) works perfectly for both systems. Also, using the power button to shutdown in the NESC menu doesn't work properly, either. You get a C8 error. Either switch back to SNESC before powering down, or just pull the power cable.

GUIDE

STEP 1:

Download a dump of the NES Classic firmware/NAND. I've only tested with dp-nes-release-v1.0.3-0-gc4c703b.tar.gz, so that's what I would recommend downloading. Go ahead and extract it after you've downloaded it.

STEP 2:

Go ahead and make a folder on your computer to house some files that we'll need to edit before sending them to the SNESC. Now, navigate to /usr/bin in the NESC dump and copy the following files to your working directory so we can edit them. Also, add -nes to the ends of the filenames (except for clover-kachikachi and kachikachi), as such:

clover-kachikachi -> (stays the same)

kachikachi -> (stays the same)

clover-factory-reset -> clover-factory-reset-nes

clover-mcp -> clover-mcp-nes

clover-menu-reset -> clover-menu-reset-nes

clover-production-test-menu -> clover-production-test-menu-nes

clover-ui -> clover-ui-nes

ReedPlayer-Clover -> ReedPlayer-Clover-nes

Also, download the following file from Github and save it to your working directory as clover-kachikachi-wr:

https://github.com/ClusterM/hakchi2/blob/stable/mods/mod_hakchi/hakchi/rootfs/bin/clover-kachikachi-wr

STEP 3:

This is the first part of manual file edits. Below, I'll outline each file that was changed and how I changed them:

clover-factory-reset-nes:

N/A

clover-kachikachi:

N/A

clover-kachikachi-wr:

Change the last line to "exec /bin/clover-kachikachi $args"

clover-mcp-nes:

This one needs to be opened in a hex editor since it's a binary (I recommend HxD as a free Windows hex editor). Open it up, and do a text replacement in the file. Essentially, we're going to make things load out of /etc/ instead of /usr/

Change "/usr/share/applications/clover-mcp.desktop" to "/etc/share/applications/clover-mcp.desktop"

clover-menu-reset-nes:

Change line 3 to "rm -rf /var/lib/clover/profiles/0//nesc-menu/"

clover-production-test-menu-nes:

N/A

clover-ui-nes:

Change line 7 to "exec taskset -c 0-1 ReedPlayer-Clover-nes \"

Change line 8 to " --bootapp=/etc/share/clover-ui \"

Change line 11 to " --script-file "/etc/share/legal/licenses.lua" \"

kachikachi:

Open this one in a hex editor.

Change both instances of "/usr/share/" to "/etc/share"

ReedPlayer-Clover-nes:

Open this one in a hex editor.

Change "/usr/share/reed-libs/sysdata/" to "/etc/share/reed-libs/sysdata/"

Change "/var/lib/clover/profiles/0//home-menu/" to "/var/lib/clover/profiles/0//nesc-menu/"

STEP 4:

Copy the above 9 files to /bin/ on your SNESC via FTP. After copying them, you'll also need to change the file permissions. Using either your FTP client (Filezilla works) or a telnet client, change the permissions on all 9 files to 777.

STEP 5:

Copy the following folders from /usr/share in the NESC firmware dump to /etc/share on your SNESC through FTP:

clover-mcp

clover-ui

kachikachi

legal

locale

reed-libs

STEP 6:

Copy the /usr/share/applications directory from the NESC firmware's dump to your working directory. Edit each file as outlined below:

clover-debug-menu.desktop:

Change line 4 to "Exec=/bin/clover-debug-menu-nes"

clover-factory-reset.desktop:

Change line 4 to "Exec=/bin/clover-factory-reset-nes"

clover-game.desktop:

N/A

clover-mcp.desktop:

Probably easier just to copy this file entirely:

[Desktop Entry]
Type=Application
Name=Clover MCP

[X-CLOVER Settings]
GamesFolder = /var/lib/hakchi/rootfs/usr/share/games/nes/kachikachi
GamesTitleFont = /var/lib/hakchi/rootfs/usr/share/games/nes/kachikachi/title.fnt
CopyrightFont = /var/lib/hakchi/rootfs/usr/share/games/nes/kachikachi/copyright.fnt
GamesListFile = /etc/clover/games-list

StateFile = /var/lib/clover/profiles/0//mcp-state
CommandFile = /var/cache/clover//command
MenuLuaFile = /var/cache/clover//menu.lua

SaveGamePersistentPath = /var/lib/clover/profiles/0/
SaveGameVolatilePath = /var/cache/clover//volatile
SaveGameVolatileBackupPath = /var/lib/clover/profiles/0//volatile

DefaultLangFile = /etc/clover/LANGUAGE
UserLangFile = /var/lib/clover/profiles/0//lang.txt

DefaultAutoShutdownDelay = 3600
UserAutoShutdownDelayFile = /var/lib/clover/profiles/0//shutdown.txt

DebugMenuDesktop = /etc/share/applications/clover-debug-menu.desktop
MenuDesktop = /etc/share/applications/clover-ui.desktop
TestMenuDesktop = /etc/share/applications/clover-test-menu.desktop
FactoryResetDesktop = /etc/share/applications/clover-factory-reset.desktop
MenuResetDesktop = /etc/share/applications/clover-menu-reset.desktop

FramebufferPath = /dev/fb0
DispDevPath = /dev/disp
SplashStartup = /etc/share/clover-mcp/splash/startup.lzo
SplashShutdown = /etc/share/clover-mcp/splash/shutdown.lzo

MenuResolution = 1280x720-60
GameResolution = 1280x720-60
SplashResolution = 1280x720-60

DaemonMode = true
DebugMode = false

[X-CLOVER Errors]
Unknown = /etc/share/clover-mcp/splash/errors/unknown.lzo
StartupFailed = /etc/share/clover-mcp/splash/errors/startup-failed.lzo

clover-menu-reset.desktop:

Change line 4 to "Exec=/bin/clover-menu-reset-nes"

clover-test-menu.desktop:

Change line 4 to "Exec=/bin/clover-production-test-menu-nes"

clover-ui.desktop:

Change line 4 to "Exec=/bin/clover-ui-nes"

STEP 7:

Once done editing, copy the above 7 files to /etc/share/applications/ on your SNESC through FTP.

STEP 8:

Copy the following files from the NESC firmware's /usr/lib into the SNESC's /var/lib/hakchi/rootfs/lib folder:

liblzo2.so

liblzo2.so.2

liblzo2.so.2.0.0

Depending on how you extracted the NES dump originally, these will either be 3 separate but identical files, or one file and 2 symlinks. If it's symlinks, make sure the symlinks are recreated appropriately on your SNES, or just copy the file 3 times with all 3 names, either way works.

STEP 9:

Create a script in the SNESC called /bin/switch_to_nes. Set the file permissions to 777. The file contents should be the following:

#!/bin/sh

export LD_LIBRARY_PATH=/var/lib/hakchi/rootfs/lib

killall -KILL clover-mcp ReedPlayer-Clover clover-mcp-nes ReedPlayer-Clover-nes

clover-mcp-nes

STEP 10:

Create a script in the SNESC called /bin/switch_to_snes. Set the file permissions to 777. The file contents should be the following:

#!/bin/sh

killall -KILL clover-mcp ReedPlayer-Clover clover-mcp-nes ReedPlayer-Clover-nes

/etc/init.d/S81clover-mcp start

STEP 11:

Create a new game on your SNESC in /var/lib/hakchi/rootfs/usr/share/games/. The folder should be called CLV-S-00NES. Inside it, add two icon files called CLV-S-00NES.png and CLV-S-00NES_small.png (I made my icon a picture of an NES, you can copy existing icons). Add a file called CLV-S-00NES.desktop containing the following:

[Desktop Entry]
Type=Application
Exec=/bin/switch_to_nes
Path=/var/lib/clover/profiles/0/FOLDER
Name=Switch to NES Classic
Icon=/usr/share/games/CLV-S-00NES/CLV-S-00NES.png

[X-CLOVER Game]
Code=CLV-S-00NES
TestID=777
ID=0
Players=1
Simultaneous=0
ReleaseDate=9999-88-88
SaveCount=0
SortRawTitle=Юswitch to nes classic
SortRawPublisher=ZZZZZZZZZY
Copyright=reddit

STEP 12:

Create a new directory on the SNESC for storing the NES games at /var/lib/hakchi/rootfs/usr/share/games/nes/kachikachi/. Inside it, create a folder called CLV-P-0SNES. Similarly to the NES game in step 10, create two files inside, CLV-P-0SNES.png and CLV-P-0SNES_small.png (I made mine a picture of an SNES, you can go nutes). Also create a file called CLV-P-0SNES.desktop containing the following:

[Desktop Entry]
Type=Application
Exec=/bin/switch_to_snes
Path=/var/lib/clover/profiles/0/FOLDER
Name=Switch to SNES Classic
Icon=/var/lib/hakchi/rootfs/usr/share/games/nes/kachikachi/CLV-P-0SNES/CLV-P-0SNES.png

[X-CLOVER Game]
Code=CLV-P-0SNES
TestID=777
ID=0
Players=1
Simultaneous=0
ReleaseDate=9999-88-88
SaveCount=0
SortRawTitle=Юswitch to snes classic
SortRawPublisher=ZZZZZZZZZY
Copyright=reddit

STEP 13:

Just about ready to copy the NES games themselves over, but we first need to modify the .desktop files. Navigate to /usr/share/games/nes/kachikachi in the NESC dump you downloaded. The easiest way to proceed from here is to go through all 31 folders (30 games + PRODUCTION-TESTS) and open each folder's .desktop file in Notepad++, having all 31 tabs open simultaneously. From there, press Ctrl + F and go to the "Replace" tab. We need to make two replacements, making sure to click "Replace All in All Opened Documents" so that all 31 files are affected at once:

Replace "/usr/bin/clover-kachikachi" with "/bin/clover-kachikachi-wr"

Replace "/usr/share/games/nes/kachikachi" with "/var/lib/hakchi/rootfs/usr/share/games/nes/kachikachi"

STEP 14:

Once you've edited all 31 .desktop files, copy the entirety of the /usr/share/games/nes/kachikachi directory containing all the NESC games and your edits, plus the two .fnt files, to /var/lib/hakchi/rootfs/usr/share/games/nes/kachikachi/ on the SNESC.

That's it! From here, you can simply reboot your console and enjoy. If you followed everything correctly, you should boot into the SNESC menu with an option at the end of the games list to switch to the NESC menu, and you'll find a similar experience in the NESC menu to switch back to the SNESC menu.

If you're having issues, please make sure to check line endings in the files you manually edited, make sure you set all the file permissions correctly for executable files, etc. As I said before, this is all fairly technical and I won't be providing noob help. This is mainly for other devs with more time than I have to automate this, perhaps working it into hakchi2 as a feature. I basically just wanted to document my work and maybe someone else will make this more user-friendly :)

@zimmertr
Copy link

Awesome post!

@Jhynjhiruu
Copy link

How hard would it be to adapt this method to dual boot both kernels on a NES Mini?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment