Repair & Schematics
Nintendo Game & Watch New
ROM Hacks (Game & Watch New)
37min
if you have a new game & watch you can side load any roms you like on it, even emulators this guide will walk you through the overview steps of what to do a super easy single run setup script you can run to do all of the software setup is here https //github com/angelsix/game and watch retrosix steps required depending on if you have already done this before and have backups will depend where you need to start never done this yet you will need to follow every step attach programmer to console setup linux environment backup the original firmware patch original firmware (support dual boot and large spi) flash retro go already backed up firmware if you have done it at least once, and have a copy of a mario or zelda firmware backup, you only need to run the patch step to restore original firmware, and retro go steps to add the retro go emulator to the device this means calling flash patch sh and flash single/dual boot sh are all that is needed for a new device in short this means once you have done it once, for a new game & watch device you can simply open it straight up, solder in swd wires to the usb, chuck on a 64mb spi flash chip, close it back up, run flash patch sh and flash single/dual boot sh and its fully done ) swd wiring setup in order to program and hack the game & watch we first need to tap into the swd interface soldering st link swd wires we are going to mod the usb c port to pass the sdio and swclk points from the stm32 microcontroller out of the usb c port so we can do all modding via a custom usb c cable and not need to open the device again once done open up the game & watch with a tri wing screwdriver locate the test pads for swclk and swio solder swio to the usb c port d (bottom pin), and swclk to d+ (top pin) custom usb c to st link cable the next step is to make up a custom usb c cable on one end, and the other end soldering ground , swdio and swclk todo new image of cable in stlink once you have this cable, all you now need to do is connect the custom usb c cable to the game & watch and the other end is the st link device that connects to your pc the cable communicates through the usb c port via the new wires we soldered in place, going to the swd pins if using the genuine stlink product you also need to solder the vtref pin to the pin 1 of the programmer to work clones do not need this and should not be connected as it can inject 3 3v into the stm32 killing the mcu soldering jlink cables i personally recommend the st link as it is simpler, but if you do want to use a j link you must solder the swio, swclk, gnd, vtref and !reset pins to the header linux setup use a real pc running linux, or if your pc supports virtualization you can install ubuntu on windows from the window store there are many guides online on running the linux subsystem for windows if running through virtual machine (wsl) you will also need to install these to allow you to connect a usb from the windows host to the linux vm in short this involves downloading and installing usbipd win 3 2 0 on windows, running the following command on ubuntu sudo apt install linux tools generic hwdata sudo update alternatives install /usr/local/bin/usbip usbip /usr/lib/linux tools/ generic/usbip 20 then running an admin powershell with usbipd wsl list to find the programmer in the usb list note its busid and run usbipd wsl attach busid \<busid> in the powershell to attach it to the linux vm, followed by lsusb on ubuntu sidfe to confirm you see it automatic setup a super easy single run setup script you can run to do all of the software setup is here https //github com/angelsix/game and watch retrosix manual setup to do it manually, do the following steps below download this repository to get started sudo apt get y update sudo apt get y upgrade sudo apt get y install wget git binutils arm none eabi python3 python3 pip libhidapi hidraw0 libftdi1 libftdi1 2 lz4 libncurses5 git clone recurse submodules https //github com/ghidraninja/game and watch backup cd game and watch backup next install openocd with custom support for bank switching spi ram wget nc progress=bar https //nightly link/kbeckmann/ubuntu openocd git builder/workflows/docker/master/openocd git deb zip unzip openocd git deb zip sudo dpkg i openocd git amd64 deb sudo apt get y f install finally install gcc toolchain wget nc progress=bar https //developer arm com/ /media/files/downloads/gnu rm/10 2020q4/gcc arm none eabi 10 2020 q4 major x86 64 linux tar bz2 tar jxvf gcc arm none eabi 10 2020 q4 major x86 64 linux tar bz2 directory sudo mv gcc arm none eabi 10 2020 q4 major /opt/gcc arm none eabi and set the paths and clean up export openocd=/opt/openocd git/bin/openocd export gcc path=/opt/gcc arm none eabi/bin path=\\$path \\$gcc path \\$openocd sudo apt autoremove sudo rm i deb zip bz2 now clone all the required repositories \# clone backup git clone recurse submodules https //github com/ghidraninja/game and watch backup \# clone patch git clone https //github com/brianpugh/game and watch patch cd game and watch patch pip3 install r requirements txt make download sdk cd \# clone retro go (sylverb) git clone recurse submodules https //github com/sylverb/game and watch retro go cd game and watch retro go python3 m pip install r requirements txt make romdef cd connecting programmer to game & watch when running the scripts below to hack the game & watch, the general idea is you need to power on the device (so from battery or externally via usb), and have your programmer connected to the swd interface if you are using a j link or official stlink programmer, they cannot power the device, so you will have to plug and unplug the physical battery on the game & watch to power cycle the device if you are using a clone stlink programmer, you have the benefit of connecting up the usb c 5v pin to the 5v output of the stlink programmer, allowing you to power the game & watch from this cable at the same time as programming if you are doing this, i recommend disconnecting the battery so the device fully turns off when you unplug the usb c allowing for really easy power cycling during hacking todo show image of clone stlink usb cable sanity check from the, inside the game and watch backup repository folder, it is time to run the sanity check this makes sure all tools were installed correctly export openocd="/opt/openocd git/bin/openocd" /1 sanity check sh stlink mario running sanity checks looks good! swap stlink with jlink or rpi if using a j link or raspberry pi, and mario for zelda if using a zelda game & watch backup flash make sure your programmer is connected to your pc, and to the game & watch, and that the game & watch has power (via battery or programmer) turn on the game & watch, then go to the clock screen depending on how you made your usb c cable, you might have a cable that has independent d+ and d pins on each side, meaning your cable will only work one way if it doesn't work one way just flip your cable around run the backup script inside the game and watch backup folder export openocd="/opt/openocd git/bin/openocd" /2 backup flash sh stlink mario swap stlink with jlink or rpi if using a j link or raspberry pi, and mario for zelda if using a zelda game & watch if all goes well it should reboot the console and dump the firmware into the folder backups inside where the script files are backup internal flash now we have the flash backed up, we must also backup the internal flash run the backup internal flash script /3 backup internal flash sh stlink mario validating itcm dump this step will overwrite the contents of the spi flash chip that we backed up in step 2 it will be restored in step 5 continue? (y/n) ygenerating encrypted flash image from backed up data programming payload to spi flash flash successfully programmed now do the following procedure \ disconnect power from the device \ power it again \ press and hold the power button on the device \ the lcd should show a blue screen \ if it's not blue, you can try pressing the time button on the device \ press return (while still holding the power button)! dumping internal flash verifying internal flash backup device backed up successfully swap stlink with jlink or rpi if using a j link or raspberry pi, and mario for zelda if using a zelda game & watch once done you should end up with the internal backup file too unlocking the next step is now to run the unlock script to unlock the stm32 it is as simple as following the instructions given run the unlock script follow the guide given /4 unlock device sh stlink mario unlocking your device will erase its internal flash even though your backup is validated, this still can go wrong are you sure? (y/n) y validating internal flash backup before proceeding unlocking device (takes up to 30 seconds ) congratulations, your device has been unlocked just a few more steps! \ the game & watch will not yet be functional \ disconnect power from the device for the changes to take full effect \ power it again \ run the 5 restore sh script to restore the spi and internal flash swap stlink with jlink or rpi if using a j link or raspberry pi, and mario for zelda if using a zelda game & watch restoring firmware the final step before swapping the spi ram is to restore the original but unlocked firmware it is as simple as following the instructions given run the restore script follow the guide given /5 restore sh stlink mario stlink mario swap stlink with jlink or rpi if using a j link or raspberry pi, and mario for zelda if using a zelda game & watch upgrading spi ram now desolder the old spi ram and solder in your new larger spi ram such as the 64mb chip mx25u51245gz4i00 it is as simple as desoldering the old one and soldering in the new important once you have the larger flash installed, you cannot run any of the backup and restore scripts except unlock, as those scripts do not support larger flash once you have the large flash installed, just run the flash patch sh script to restore the original firmware, or the flash single/dual boot sh scripts to flash the retro go emulator patching firmware (dual boot) now you have your game & watch unlocked and the stock firmware reinstalled, if you would like to dual boot retro go (have the original ui and games on the game & watch and run the retro go emulator by pressing game + left ) you must patch the firmware on the device if you play to run only retro go and no original ui, you can skip this step first clone the patch github code git clone https //github com/brianpugh/game and watch patch cd game and watch patch pip3 install r requirements txt make download sdk next run the following commands changing stlink and mario as needed do this while holding the power button and having the programmer connected also note we have large flash=1 flag as we are using the 64mb (512mbit) spi flash export gcc path=/opt/gcc arm none eabi/bin make clean make patch params=" device=mario" large flash=1 flash patched adapter=stlink as you hit enter on the last command it will attempt to program the device so make sure its all connected and power button is held down if the command fails just keep re trying the command while holding the power button it takes several attempts to get it working sometimes once it works it will look like this, and seem to mention errors but its worked fine make patch params=" device=mario" large flash=1 flash patched adapter=stlink python3 scripts/check env vars py "flash patched" build/env " device=mario" /opt/openocd git/bin/openocd f openocd/interface "stlink" cfg \\ c "init; halt;" \\ c "program build/internal flash patched bin 0x08000000 "";" \\ c "reset; exit;" open on chip debugger 0 12 0+dev 00359 gc7d1f0dda dirty (2023 10 16 02 12) licensed under gnu gpl v2 for bug reports, read http //openocd org/doc/doxygen/bugs html info device stm32h7ax/7bx info flash size probed value 128k info stm32h7 flash has dual banks info bank (0) size is 256 kb, base address is 0x08000000 initializing octo spi interface info device has to be switched to 4 byte addresses info 4 byte address parameter table info valid sfdp detected info flash1 'sfdp' id = 0x3a25c2 size = 65536 kib error fsize in dcr(1) doesn't match actual capacity programming started programming finished info device stm32h7ax/7bx info device stm32h7ax/7bx info flash size probed value 128k info stm32h7 flash has dual banks info bank (0) size is 256 kb, base address is 0x08000000 initializing octo spi interface error target not halted error executing event reset end on target stm32h7x cpu0 embedded\ startup tcl 1201 error in procedure 'ocd process reset' in procedure 'ocd process reset inner' called at file "embedded\ startup tcl", line 1201 make\[1] leaving directory '/home/luke/game and watch noob installer/game and watch noob installer/game and watch patch' now power off and on the console and it should be running the stock firmware again, but now with patched firmware ready for dual boot to test it worked, turn on the game & watch and press game + left it should turn the screen black (because retro go isn't yet on the spi) retro go finally time for the fun part loading up the retro go emulator this emulator can play games from the following consoles colecovision (col) gameboy / gameboy color (gb/gbc) game & watch / lcd games (gw) nintendo entertainment system (nes) pc engine / turbografx 16 (pce) sega game gear (gg) sega master system (sms) sega sg 1000 (sg) for this you can use many versions of retro go, including https //github com/kbeckmann/game and watch retro go (basic ui) https //github com/sylverb/game and watch retro go (nice ui with thumbnails) https //github com/olderzeus/game and watch retro go (nicer ui with thumbnails) for this i'm going to use the sylverb variant, but the same steps are used for all git clone recurse submodules https //github com/sylverb/game and watch retro go cd game and watch retro go python3 m pip install r requirements txt make romdef adding roms now after running the above commands you will have a roms folder inside there is each console to place your roms in for screenshots make them the size they specify in the list above and call them the exact same name as the rom file but with a png extension once done your folder should look something like this (nes folder inside roms as the example) single boot image if you don't care about the original game & watch ui and dual games, you can just flash over the top of the firmware completely make j8 gnw target=mario extflash size mb=64 coverflow=1 the coverflow flag is used to make sure we get thumbnails note if you didn't upgrade your spi to 64mb you can omit the extflash size mb statement, or change it to the size of your spi you upgraded to dual boot image to preserver the original firmware, and have the retro go open up when you press game and left on the game & watch console, build the image with the following command make clean make j8 gnw target=mario extflash size mb=63 coverflow=1 extflash offset=1048576 intflash bank=2 note if you didn't upgrade your spi to 64mb you can omit the extflash size mb statement, or change it to the size of your spi you upgraded to this is for the 64mb spi flash and mario for zelda the original flash was 4mb so the command and offset is like this make clean make extflash size mb=60 extflash offset=4194304 intflash bank=2 coverflow=1 this will compile the image ready for flashing flashing image to flash to the device, turn it on, connect the programmer, hold the power button and run make adapter=stlink gnw target=mario flash change mario to zelda if flashing zelda, and stlink to jlink as required once you see the game and watch flash app appear on screen you can let go of the power button getting thumbnails either screenshot your own from emulators, or get many from places like https //github com/libretro thumbnails/libretro thumbnails run the images through a resizer to the correct size (128x96) here https //bulkresizephotos com/ https //bulkresizephotos com/