foxygit / fake-08-xbox360 Log in
commit 7db38cd8c4c6a6db4f17f457724ef7bff76948b5
Author:     mrfox <jens.se@icloud.com>
AuthorDate: Wed Nov 25 18:47:34 2026 +0100
Commit:     mrfox <jens.se@icloud.com>
CommitDate: Wed Nov 25 18:47:34 2026 +0100

    xex host: log the build id and time

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---
 platform/xex/Makefile           | 5 ++++-
 platform/xex/source/XexHost.cpp | 7 ++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/platform/xex/Makefile b/platform/xex/Makefile
index 1f95bf1..7301a30 100644
--- a/platform/xex/Makefile
+++ b/platform/xex/Makefile
@@ -40,11 +40,12 @@ CORE_SRC    := $(foreach d,$(CORE_DIRS),$(wildcard $(d)/*.c) $(wildcard $(d)/*.c
 CORE_OBJ    := $(patsubst ../../%,$(BUILD)/fake08/core/%.o,$(CORE_SRC))
 FAKE08_OBJ  := $(CORE_OBJ) $(BUILD)/fake08/XexHost.cpp.o
 APP_VERSION ?= dev
+BUILD_ID    := $(shell git -C $(CURDIR) rev-parse --short HEAD 2>/dev/null || echo unknown)$(shell git -C $(CURDIR) diff --quiet 2>/dev/null || echo -modified)
 # z8lua's .c files are C++ (fix32 math, throw/catch for Lua errors).
 # libxenon's headers come last, for the console font only.
 FAKE08_FLAGS := $(MACH) -O2 -g -Wall -Wno-sign-compare -Wno-attributes -ffunction-sections -fdata-sections \
                 $(INCLUDES) $(foreach d,$(CORE_DIRS),-I$(d)) -idirafter $(DEVKITXENON)/usr/include \
-                -D__XEX__ -DMINIZ_NO_TIME -DVER_STR=\"$(APP_VERSION)\" -std=gnu++17
+                -D__XEX__ -DMINIZ_NO_TIME -DVER_STR=\"$(APP_VERSION)\" -DBUILD_ID=\"$(BUILD_ID)\" -std=gnu++17

 .PHONY: all tests runtime fake08 clean
 all: tests fake08
@@ -60,6 +61,8 @@ $(BUILD)/fake08/core/%.cpp.o: ../../%.cpp
 	@mkdir -p $(dir $@)
 	@echo [$(notdir $<)]
 	@$(CXX) $(FAKE08_FLAGS) -MMD -MP -c $< -o $@
+# rebuilt every time, for the build id and time in the log
+.PHONY: $(BUILD)/fake08/XexHost.cpp.o
 $(BUILD)/fake08/XexHost.cpp.o: source/XexHost.cpp
 	@mkdir -p $(dir $@)
 	@echo [$(notdir $<)]
diff --git a/platform/xex/source/XexHost.cpp b/platform/xex/source/XexHost.cpp
index e70a304..c4acf15 100644
--- a/platform/xex/source/XexHost.cpp
+++ b/platform/xex/source/XexHost.cpp
@@ -44,6 +44,10 @@

 using namespace std;

+#ifndef BUILD_ID
+#define BUILD_ID "dev"
+#endif
+
 static const int PicoScreenWidth = 128;
 static const int PicoScreenHeight = 128;

@@ -437,7 +441,8 @@ void Host::setPlatformParams(
     std::string cartDirectory) {}

 void Host::oneTimeSetup(Audio *audio) {
-    Logger_Write("FAKE-08 for Xbox 360 (XEX), carts in %s\n", _cartDirectory.c_str());
+    Logger_Write("FAKE-08 for Xbox 360 (XEX) %s, built %s %s, carts in %s\n", BUILD_ID, __DATE__, __TIME__,
+                 _cartDirectory.c_str());
     videoOk = fbInit();
     if (!videoOk) {
         xex_notify("FAKE-08: video init failed");