aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-05-23 18:09:09 +0200
committerBad Diode <bd@badd10de.dev>2021-05-23 18:09:09 +0200
commita928aab86ec33f385b749771747d1097b1fba277 (patch)
tree53f03275c0adecda8eea52af7ffb5f0eb499b7a1
parentc0f6187b99a1d82db71616ec67286b295cc27636 (diff)
downloaduxngba-a928aab86ec33f385b749771747d1097b1fba277.tar.gz
uxngba-a928aab86ec33f385b749771747d1097b1fba277.zip
Add some configuration parameters for compilation
-rw-r--r--Makefile2
-rw-r--r--src/main.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9d830b8..427861c 100644
--- a/Makefile
+++ b/Makefile
@@ -34,10 +34,12 @@ CC := $(DEVKITBIN)/arm-none-eabi-gcc
34OBJCOPY := $(DEVKITBIN)/arm-none-eabi-objcopy 34OBJCOPY := $(DEVKITBIN)/arm-none-eabi-objcopy
35ARCH := -mthumb -mthumb-interwork 35ARCH := -mthumb -mthumb-interwork
36SPECS := -specs=gba.specs 36SPECS := -specs=gba.specs
37CONFIG :=
37CFLAGS := -Wall -Wextra -pedantic -Wno-incompatible-pointer-types 38CFLAGS := -Wall -Wextra -pedantic -Wno-incompatible-pointer-types
38CFLAGS += -fno-strict-aliasing 39CFLAGS += -fno-strict-aliasing
39CFLAGS += -mcpu=arm7tdmi -mtune=arm7tdmi $(ARCH) 40CFLAGS += -mcpu=arm7tdmi -mtune=arm7tdmi $(ARCH)
40CFLAGS += $(INC_FLAGS) 41CFLAGS += $(INC_FLAGS)
42CFLAGS += $(CONFIG)
41LDFLAGS := $(ARCH) $(SPECS) 43LDFLAGS := $(ARCH) $(SPECS)
42LDLIBS := $(LIBGBA) 44LDLIBS := $(LIBGBA)
43RELEASE_CFLAGS := -DNDEBUG -O2 45RELEASE_CFLAGS := -DNDEBUG -O2
diff --git a/src/main.c b/src/main.c
index f612ef7..dd4145a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,12 +23,23 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
23WITH REGARD TO THIS SOFTWARE. 23WITH REGARD TO THIS SOFTWARE.
24*/ 24*/
25 25
26//
27// Config parameters.
28//
29#ifndef TEXT_LAYER
30#define TEXT_LAYER ppu.fg
31#endif
32
33#ifndef DEFAULT_CONTROL
34#define DEFAULT_CONTROL CONTROL_CONTROLLER
35#endif
36
26typedef enum { 37typedef enum {
27 CONTROL_CONTROLLER, 38 CONTROL_CONTROLLER,
28 CONTROL_MOUSE, 39 CONTROL_MOUSE,
29} ControlMethod; 40} ControlMethod;
30 41
31static ControlMethod control_method = CONTROL_CONTROLLER; 42static ControlMethod control_method = DEFAULT_CONTROL;
32 43
33#define MOUSE_DELTA 1 44#define MOUSE_DELTA 1
34typedef struct Mouse { 45typedef struct Mouse {
@@ -280,7 +291,7 @@ int main(void) {
280 init_uxn(&u); 291 init_uxn(&u);
281 292
282 // Initialize text engine. 293 // Initialize text engine.
283 txt_init(1, ppu.fg); 294 txt_init(1, TEXT_LAYER);
284 txt_position(0,0); 295 txt_position(0,0);
285 296
286 // Main loop. 297 // Main loop.