diff options
author | Bad Diode <bd@badd10de.dev> | 2021-05-20 10:34:32 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-05-20 10:34:32 +0200 |
commit | 3daf0d136cf0074cc371591892db179567e971eb (patch) | |
tree | 4a6936e1414ec0a08b10f0d6e9a5894a8f2bf465 | |
parent | 9911609e8fff312c406e3407a519b39db79bdb97 (diff) | |
download | uxngba-3daf0d136cf0074cc371591892db179567e971eb.tar.gz uxngba-3daf0d136cf0074cc371591892db179567e971eb.zip |
Update build system to build the boot data on the fly
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | src/main.c | 8 |
3 files changed, 13 insertions, 7 deletions
@@ -1 +1,2 @@ | |||
1 | build | 1 | build |
2 | src/uxn/roms/boot.c | ||
@@ -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. |
15 | SRC_DIR := src | 15 | SRC_DIR := src |
16 | SRC_MAIN := $(SRC_DIR)/main.c | 16 | SRC_MAIN := $(SRC_DIR)/main.c |
17 | ROM := $(SRC_DIR)/uxn/roms/boot.c | ||
18 | ROM_SRC := $(SRC_DIR)/uxn/roms/dvd.rom | ||
17 | ASM_FILES := $(wildcard $(SRC_DIR)/*.s) | 19 | ASM_FILES := $(wildcard $(SRC_DIR)/*.s) |
18 | WATCH_SRC := $(wildcard $(SRC_DIR)/*.c) | 20 | WATCH_SRC := $(wildcard $(SRC_DIR)/*.c) |
19 | WATCH_SRC += $(wildcard $(SRC_DIR)/*.h) | 21 | WATCH_SRC += $(wildcard $(SRC_DIR)/*.h) |
@@ -50,7 +52,13 @@ else | |||
50 | CFLAGS += $(RELEASE_CFLAGS) | 52 | CFLAGS += $(RELEASE_CFLAGS) |
51 | endif | 53 | endif |
52 | 54 | ||
53 | main: $(BUILD_DIR) $(BIN) | 55 | main: $(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. |
73 | clean: | 81 | clean: |
82 | rm $(ROM) | ||
74 | rm -r $(BUILD_DIR) | 83 | rm -r $(BUILD_DIR) |
@@ -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(); |