From cb88c7e2dc279429253869c5803576ecb6cb7f4c Mon Sep 17 00:00:00 2001 From: LiquidFenrir Date: Sat, 9 Dec 2017 06:57:48 +0100 Subject: [PATCH] make rule for simpler citra testing (#110) disables the 2 disruptive parts --- Makefile | 6 ++++++ source/draw.c | 2 ++ source/main.c | 2 ++ 3 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 8efcd53..4aee6f0 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,9 @@ CFLAGS := -g -Wall -Wextra -O2 -mword-relocations \ revision := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/') CFLAGS += $(INCLUDE) -DARM11 -D_3DS -D_GNU_SOURCE -DVERSION="\"$(revision)\"" -DUSER_AGENT="\"$(APP_TITLE)/$(revision)\"" +ifneq ($(strip $(CITRA_MODE)),) + CFLAGS += -DCITRA_MODE +endif CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11 @@ -146,6 +149,9 @@ all: 3dsx cia 3dsx: $(BUILD) $(OUTPUT).3dsx cia : $(BUILD) $(OUTPUT).cia + +citra: export CITRA_MODE = 1 +citra: 3dsx #--------------------------------------------------------------------------------- $(BUILD): @mkdir -p $(OUTDIR) diff --git a/source/draw.c b/source/draw.c index ff0ea93..914ae02 100644 --- a/source/draw.c +++ b/source/draw.c @@ -77,6 +77,7 @@ static void draw_base_interface(void) pp2d_draw_text(28, 1, 0.6, 0.6, COLOR_WHITE, (tm.tm_sec % 2 == 1) ? ":" : " "); pp2d_draw_textf(34, 2, 0.6, 0.6, COLOR_WHITE, "%.2i", tm.tm_min); + #ifndef CITRA_MODE u8 battery_charging = 0; PTMU_GetBatteryChargeState(&battery_charging); u8 battery_status = 1; @@ -85,6 +86,7 @@ static void draw_base_interface(void) if(battery_charging) pp2d_draw_texture(TEXTURE_BATTERY_CHARGE, 357, 2); + #endif pp2d_draw_on(GFX_BOTTOM, GFX_LEFT); pp2d_draw_rectangle(0, 0, 320, 24, COLOR_ACCENT); diff --git a/source/main.c b/source/main.c index 9d5bcbd..ce54639 100644 --- a/source/main.c +++ b/source/main.c @@ -140,11 +140,13 @@ int main(void) while(aptMainLoop()) { + #ifndef CITRA_MODE if(R_FAILED(archive_result) && current_mode == MODE_THEMES) { throw_error("Theme extdata does not exist!\nSet a default theme from the home menu.", ERROR_LEVEL_ERROR); break; } + #endif hidScanInput(); u32 kDown = hidKeysDown();