From a928aab86ec33f385b749771747d1097b1fba277 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 23 May 2021 18:09:09 +0200 Subject: Add some configuration parameters for compilation --- Makefile | 2 ++ src/main.c | 15 +++++++++++++-- 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 OBJCOPY := $(DEVKITBIN)/arm-none-eabi-objcopy ARCH := -mthumb -mthumb-interwork SPECS := -specs=gba.specs +CONFIG := CFLAGS := -Wall -Wextra -pedantic -Wno-incompatible-pointer-types CFLAGS += -fno-strict-aliasing CFLAGS += -mcpu=arm7tdmi -mtune=arm7tdmi $(ARCH) CFLAGS += $(INC_FLAGS) +CFLAGS += $(CONFIG) LDFLAGS := $(ARCH) $(SPECS) LDLIBS := $(LIBGBA) RELEASE_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 WITH REGARD TO THIS SOFTWARE. */ +// +// Config parameters. +// +#ifndef TEXT_LAYER +#define TEXT_LAYER ppu.fg +#endif + +#ifndef DEFAULT_CONTROL +#define DEFAULT_CONTROL CONTROL_CONTROLLER +#endif + typedef enum { CONTROL_CONTROLLER, CONTROL_MOUSE, } ControlMethod; -static ControlMethod control_method = CONTROL_CONTROLLER; +static ControlMethod control_method = DEFAULT_CONTROL; #define MOUSE_DELTA 1 typedef struct Mouse { @@ -280,7 +291,7 @@ int main(void) { init_uxn(&u); // Initialize text engine. - txt_init(1, ppu.fg); + txt_init(1, TEXT_LAYER); txt_position(0,0); // Main loop. -- cgit v1.2.1