commit aee9c4199582c85e4fa668fd3186cf9bc77e0d69 Author: jonncode Date: Sun Dec 8 14:34:20 2024 +0100 first commit diff --git a/mcugotchi b/mcugotchi new file mode 160000 index 0000000..50dd2b3 --- /dev/null +++ b/mcugotchi @@ -0,0 +1 @@ +Subproject commit 50dd2b3ed3707980d367ce69a2dbf74bba715cae diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..af5dc34 --- /dev/null +++ b/readme.md @@ -0,0 +1,88 @@ + +# 1. Setting Up the Project Directory + +``` +mkdir gothci +cd gotchi/ +``` + +# 2. Installing Basic Development Tools + +``` +sudo apt update && sudo apt upgrade -y +sudo apt install build-essential git make gcc-mingw-w64 g++-mingw-w64 zip -y +``` +__Note: gcc-mingw-w64 and g++-mingw-w64 may not be necessary if you're only targeting Linux builds.__ + +# 3. Cloning and setting up the tamatool Repository + +``` +git clone --recursive https://github.com/jcrona/tamatool.git +``` + +# 4. Installing SDL2 Dependencies + +``` +sudo apt install libsdl2-dev libsdl2-image-dev libpng-dev -y +``` + +# 5. Building tamatool for Windows/Linux (I used Linux) + +```make linux ``` or ```make windows``` +I used `make linux` because I am using WSL. WSL2 should work since it's using openocd. + +# 7. Updating System and Installing Cross-Compilation Tools + +`sudo apt install build-essential git cmake gcc-arm-none-eabi openocd dfu-util` + +# 8. Cloning the mcugotchi Repository + +`cd ..` +`git clone --recursive https://github.com/jcrona/mcugotchi.git` +__Note: If you don't use recursive you won't get the necessary includes.__ + +# 9. Generating rom.h from a ROM File + +__Note: These steps are already done in the provided folder__ + +Place the `tama.b` file from the [zip file](https://www.planetemu.net/rom/mame-roms/tama) into mcugotchi/src/ and rename it to `tama.bin` + +`nano mcugotchi/src/rom.c` +Remove '//' from //#define ROM_BUILT_IN at line 30. + +cd tamatool/linux/dist +./tamatool -r ../mcugotchi/src/tama.bin -H > ../mcugotchi/src/rom_data.h +__Note: The command in the GitHub repo for Tamatool is wrong, the output file is "rom.h" in the provided command, which literally overrides the header file used for loading the ROM.__ + +# 10. Compiling mcugotchi + +`cd ../../../mcugotchi` +`nano Makefile` + +Edit the makefile, remove the text after `TOOLCHAIN =` and `OPENOCD_BIN =`. + +``` +# GNU ARM Embedded Toolchain location +TOOLCHAIN = + +# OpenOCD location +OPENOCD_BIN = +``` + +Then remove `$(TOOLCHAIN)/bin/` from all other lines. + +``` +CC = arm-none-eabi-gcc +AS = arm-none-eabi-as +LN = arm-none-eabi-gcc +STRIP = arm-none-eabi-strip +HEX = arm-none-eabi-objcopy -O ihex +BIN = arm-none-eabi-objcopy -O binary +``` + +Now we should be able to compile mcugotchi. +`make` + +# 11. Flashing mcugotchi +Inside of mcugotchi folder: +`make flash` \ No newline at end of file diff --git a/tamatool b/tamatool new file mode 160000 index 0000000..78deba2 --- /dev/null +++ b/tamatool @@ -0,0 +1 @@ +Subproject commit 78deba2052741de8a893443fb690f835e3f44384