From 3daf0d136cf0074cc371591892db179567e971eb Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Thu, 20 May 2021 10:34:32 +0200 Subject: Update build system to build the boot data on the fly --- .gitignore | 1 + Makefile | 11 ++++++++++- src/main.c | 8 ++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 378eac2..7810e33 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +src/uxn/roms/boot.c diff --git a/Makefile b/Makefile index 6d7a5ec..07b662b 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ LIBGBA += $(LIBGBA_DIR)/lib/libmm.a # Source code location and files to watch for changes. SRC_DIR := src SRC_MAIN := $(SRC_DIR)/main.c +ROM := $(SRC_DIR)/uxn/roms/boot.c +ROM_SRC := $(SRC_DIR)/uxn/roms/dvd.rom ASM_FILES := $(wildcard $(SRC_DIR)/*.s) WATCH_SRC := $(wildcard $(SRC_DIR)/*.c) WATCH_SRC += $(wildcard $(SRC_DIR)/*.h) @@ -50,7 +52,13 @@ else CFLAGS += $(RELEASE_CFLAGS) endif -main: $(BUILD_DIR) $(BIN) +main: $(BUILD_DIR) $(ROM) $(BIN) + +$(ROM): + ../tools/bin2carr/build/bin2carr $(ROM_SRC) \ + -n uxn_rom \ + -e u16 \ + -o $(ROM) # Strip and fix header to create final .gba file. $(BIN): $(ELF) @@ -71,4 +79,5 @@ run: main # Remove build directory. clean: + rm $(ROM) rm -r $(BUILD_DIR) diff --git a/src/main.c b/src/main.c index df78355..c302480 100644 --- a/src/main.c +++ b/src/main.c @@ -9,11 +9,7 @@ #include "uxn/uxn.c" #include "uxn/devices/ppu.h" #include "uxn/devices/ppu.c" -// #include "uxn/roms/console.c" -// #include "uxn/roms/proportional_fonts.c" -#include "uxn/roms/dvd.c" -// #include "uxn/roms/automata.c" -// #include "uxn/roms/life.c" +#include "uxn/roms/boot.c" #include "text.h" /* @@ -126,7 +122,6 @@ int main(void) { // Initialize VM. Uxn u = {0}; init_uxn(&u); - evaluxn(&u, 0x0100); // Initialize text engine. txt_init_hybrid( @@ -139,6 +134,7 @@ int main(void) { // Main loop. int frame_counter = 0; + evaluxn(&u, 0x0100); while(true) { bios_vblank_wait(); poll_keys(); -- cgit v1.2.1