From 48da3bc9121891d5310b1854592c9626d3e82716 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 13 Mar 2023 00:46:13 +0000 Subject: [PATCH] Makefile improvements Improve readme Add instructions for new sc64 deployer. Improve .gitignore --- .gitignore | 4 ++++ Makefile | 20 +++++++++++--------- README.md | 10 +++++----- deploy.bat | 4 ++-- tools/sc64/README.md | 12 +++++------- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 11b26609..275613f0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ /build /output tools/sc64/sc64.exe +tools/sc64/sc64deployer.exe +# There should never be ROMs uploaded, but just incase, make sure they are excluded. +**/*.n64 +**/*.z64 diff --git a/Makefile b/Makefile index 7e370b06..875ed913 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ -.DEFAULT_GOAL := menu -EXE_NAME = N64FlashcartMenu +PROJECT_NAME = N64FlashcartMenu + +.DEFAULT_GOAL := $(PROJECT_NAME) SOURCE_DIR = src BUILD_DIR = build @@ -28,18 +29,18 @@ SRCS = \ OBJS = $(addprefix $(BUILD_DIR)/, $(addsuffix .o,$(basename $(SRCS)))) -$(BUILD_DIR)/$(EXE_NAME).elf: $(OBJS) +$(BUILD_DIR)/$(PROJECT_NAME).elf: $(OBJS) -$(EXE_NAME).z64: N64_ROM_TITLE=$(EXE_NAME) +$(PROJECT_NAME).z64: N64_ROM_TITLE=$(PROJECT_NAME) - menu: $(EXE_NAME).z64 +$(PROJECT_NAME): $(PROJECT_NAME).z64 $(shell mkdir -p $(OUTPUT_DIR)) - $(shell mv $(EXE_NAME).z64 $(OUTPUT_DIR)) + $(shell mv $(PROJECT_NAME).z64 $(OUTPUT_DIR)) -sc64_minify: - $(shell python3 ./tools/sc64/minify.py $(BUILD_DIR)/$(EXE_NAME).elf $(OUTPUT_DIR)/N64FlashcartMenu.z64 $(OUTPUT_DIR)/sc64menu.n64) +sc64_minify: $(PROJECT_NAME) + $(shell python3 ./tools/sc64/minify.py $(BUILD_DIR)/$(PROJECT_NAME).elf $(OUTPUT_DIR)/$(PROJECT_NAME).z64 $(OUTPUT_DIR)/sc64menu.n64) -all: menu sc64_minify +all: sc64_minify .PHONY: all clean: @@ -48,6 +49,7 @@ clean: .PHONY: clean # run: +# $(shell sc64deployer --boot direct-rom %~dp0$(OUTPUT_DIR))\$(PROJECT_NAME).z64) # test: diff --git a/README.md b/README.md index 184f1c82..4d5782f0 100644 --- a/README.md +++ b/README.md @@ -61,15 +61,15 @@ You can use a dev container in VSCode to ease development. Note: the dev container currently downloads and installs the latest available libdragon from the stable branch, rather than use the repos submodule. To deploy: -* Download the deployer [here](https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.12.1/sc64-windows-v2.12.1.zip) -* Extract and place `sc64.exe` in the `tools/sc64` directory +* Download the deployer [here](https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.14.0/sc64-deployer-windows-v2.14.0.zip) +* Extract and place `sc64deployer.exe` in the `tools/sc64` directory * For the moment, deployment cannot happen within the dev container and you must do it from a terminal on the host. * Run `./deploy.bat` from the terminal (in windows) * Toggle the N64 power switch to load the ROM. `ms-vscode.makefile-tools` will help (installed automatically in dev container). TODO: it does not yet work with `F5`: see https://devblogs.microsoft.com/cppblog/now-announcing-makefile-support-in-visual-studio-code/ -WORKAROUND: in the dev container terminal, use make directly `make all` -The ROM can be found in the `build` directory. +WORKAROUND: in the dev container terminal, use make directly, i.e.: `make` +The ROM can be found in the `output` directory. -NOTE: a "release" version of the ROM is called `sc64menu.n64` is created for when you want to add it directly to the SDCard. +NOTE: a "release" version of the SC64 menu is called `sc64menu.n64` and can be created for when you want to add it directly to the SDCard. This is generated by running `make all` or running `make sc64_minify`. diff --git a/deploy.bat b/deploy.bat index 01e04b97..29989a83 100644 --- a/deploy.bat +++ b/deploy.bat @@ -4,13 +4,13 @@ cd %~dp0tools\sc64\ :: Make sure we are connected echo Detecting SC64... -sc64 --print-state +sc64deployer --print-state echo: echo: :: Load the ROM echo Loading ROM... -sc64 --boot direct-rom %~dp0output\N64FlashcartMenu.z64 +sc64deployer --boot direct-rom %~dp0output\N64FlashcartMenu.z64 echo: echo: diff --git a/tools/sc64/README.md b/tools/sc64/README.md index 1711fabf..a9da9a03 100644 --- a/tools/sc64/README.md +++ b/tools/sc64/README.md @@ -1,14 +1,12 @@ # Source -https://github.com/Polprzewodnikowy/SummerCart64 +This Directory. # License -GPL-3.0 license +See root directory. # Description -Used for build and deployment +`minify.py` +Removes unnecessary null bytes from the end of ROM file to cut on menu load time from SD card. # Notes -It might be preferable to change to a submodule. -But `finalize.py` is independent. - -The deployer needs to be downloaded from https://github.com/Polprzewodnikowy/SummerCart64/releases/tag/v2.12.1 and placed in this folder. +The deployer `sc64deployer` needs to be downloaded from https://github.com/Polprzewodnikowy/SummerCart64/releases/tag/v2.14.0 and placed in this folder.