diff --git a/Makefile.arm9 b/Makefile.arm9 index 567ed73..7f98d50 100644 --- a/Makefile.arm9 +++ b/Makefile.arm9 @@ -56,11 +56,15 @@ endif ifeq ($(strip $(NO_COMMIT_HASH)),) - DEFINES += -DCOMMIT_HASH="\" $(shell git rev-parse --short=8 HEAD)\"" + DEFINES += -DCOMMIT_HASH="\"-$(shell git rev-parse --short=8 HEAD)\"" else DEFINES += -DCOMMIT_HASH=\"\" endif +VERSION_STR := '$(shell git describe --tags --match v[0-9]*)' +DEFINES += -DVER_MAJOR=$(shell echo $(VERSION_STR) | sed -e 's/v//i' -e 's/\.[0-9]*//') +DEFINES += -DVER_MINOR=$(shell echo $(VERSION_STR) | sed 's/v[0-9]*\.//i') + .PHONY: clean release diff --git a/source/arm9/menu.c b/source/arm9/menu.c index 4e0a094..f6e1018 100644 --- a/source/arm9/menu.c +++ b/source/arm9/menu.c @@ -10,7 +10,6 @@ #include "fatfs/ff.h" #include "fatfs/diskio.h" #include "hid.h" -#include "version.h" #include "arm9/main.h" #include "arm9/menu.h" #include "arm9/menu_firmloader.h" @@ -65,8 +64,7 @@ consoleSelect(&con_top); - uiPrintCenteredInLine(1, "fastboot 3DS v%" PRIu16 ".%" PRIu16 COMMIT_HASH, - BOOTLOADER_VERSION>>16, BOOTLOADER_VERSION & 0xFFFFu); + uiPrintCenteredInLine(1, "fastboot 3DS v%" PRIu16 ".%" PRIu16 COMMIT_HASH, VER_MAJOR, VER_MINOR); uiPrintTextAt(1, 4, "Model: %s", bootInfo.model); uiPrintTextAt(1, 5, "\x1B[33m%s\e[0m", bootInfo.boot_env); diff --git a/source/arm9/start.s b/source/arm9/start.s index 0725728..cfef5f5 100644 --- a/source/arm9/start.s +++ b/source/arm9/start.s @@ -1,5 +1,4 @@ #include "mem_map.h" -#include "version.h" .arm .cpu arm946e-s @@ -32,7 +31,7 @@ __start__: .string "FASTBOOT 3DS " - .word BOOTLOADER_VERSION + .word (VER_MAJOR<<16 | VER_MINOR) _start: msr cpsr_cxsf, #0xD3 @ Disable all interrupts, SVC mode