aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-05-20 10:34:32 +0200
committerBad Diode <bd@badd10de.dev>2021-05-20 10:34:32 +0200
commit3daf0d136cf0074cc371591892db179567e971eb (patch)
tree4a6936e1414ec0a08b10f0d6e9a5894a8f2bf465
parent9911609e8fff312c406e3407a519b39db79bdb97 (diff)
downloaduxngba-3daf0d136cf0074cc371591892db179567e971eb.tar.gz
uxngba-3daf0d136cf0074cc371591892db179567e971eb.zip
Update build system to build the boot data on the fly
-rw-r--r--.gitignore1
-rw-r--r--Makefile11
-rw-r--r--src/main.c8
3 files changed, 13 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 378eac2..7810e33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
1build 1build
2src/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
14# Source code location and files to watch for changes. 14# Source code location and files to watch for changes.
15SRC_DIR := src 15SRC_DIR := src
16SRC_MAIN := $(SRC_DIR)/main.c 16SRC_MAIN := $(SRC_DIR)/main.c
17ROM := $(SRC_DIR)/uxn/roms/boot.c
18ROM_SRC := $(SRC_DIR)/uxn/roms/dvd.rom
17ASM_FILES := $(wildcard $(SRC_DIR)/*.s) 19ASM_FILES := $(wildcard $(SRC_DIR)/*.s)
18WATCH_SRC := $(wildcard $(SRC_DIR)/*.c) 20WATCH_SRC := $(wildcard $(SRC_DIR)/*.c)
19WATCH_SRC += $(wildcard $(SRC_DIR)/*.h) 21WATCH_SRC += $(wildcard $(SRC_DIR)/*.h)
@@ -50,7 +52,13 @@ else
50 CFLAGS += $(RELEASE_CFLAGS) 52 CFLAGS += $(RELEASE_CFLAGS)
51endif 53endif
52 54
53main: $(BUILD_DIR) $(BIN) 55main: $(BUILD_DIR) $(ROM) $(BIN)
56
57$(ROM):
58 ../tools/bin2carr/build/bin2carr $(ROM_SRC) \
59 -n uxn_rom \
60 -e u16 \
61 -o $(ROM)
54 62
55# Strip and fix header to create final .gba file. 63# Strip and fix header to create final .gba file.
56$(BIN): $(ELF) 64$(BIN): $(ELF)
@@ -71,4 +79,5 @@ run: main
71 79
72# Remove build directory. 80# Remove build directory.
73clean: 81clean:
82 rm $(ROM)
74 rm -r $(BUILD_DIR) 83 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 @@
9#include "uxn/uxn.c" 9#include "uxn/uxn.c"
10#include "uxn/devices/ppu.h" 10#include "uxn/devices/ppu.h"
11#include "uxn/devices/ppu.c" 11#include "uxn/devices/ppu.c"
12// #include "uxn/roms/console.c" 12#include "uxn/roms/boot.c"
13// #include "uxn/roms/proportional_fonts.c"
14#include "uxn/roms/dvd.c"
15// #include "uxn/roms/automata.c"
16// #include "uxn/roms/life.c"
17#include "text.h" 13#include "text.h"
18 14
19/* 15/*
@@ -126,7 +122,6 @@ int main(void) {
126 // Initialize VM. 122 // Initialize VM.
127 Uxn u = {0}; 123 Uxn u = {0};
128 init_uxn(&u); 124 init_uxn(&u);
129 evaluxn(&u, 0x0100);
130 125
131 // Initialize text engine. 126 // Initialize text engine.
132 txt_init_hybrid( 127 txt_init_hybrid(
@@ -139,6 +134,7 @@ int main(void) {
139 134
140 // Main loop. 135 // Main loop.
141 int frame_counter = 0; 136 int frame_counter = 0;
137 evaluxn(&u, 0x0100);
142 while(true) { 138 while(true) {
143 bios_vblank_wait(); 139 bios_vblank_wait();
144 poll_keys(); 140 poll_keys();