Version stamping: 4.11.<git commit count> (<hash>[+])
4.10 = the 1995 arcade release; 4.11 = the win32 reconstruction; the
build number is the git commit count -- monotonic, zero-maintenance,
and every exe pins to exact source via the short hash ('+' = built
from an uncommitted tree). tools/btversion.cmake regenerates
build/btversion.h on every build (write-if-changed, no rebuild churn);
the stamp shows in the boot banner (btl4.log head, replacing the stale
'v4.10' line) and the window title (incl. the MP node tag).
Verified: build stamps 4.11.311 (980c9cd+), banner + title correct on
a live boot.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
980c9cd7e5
commit
fad962bec8
@@ -308,8 +308,19 @@ target_compile_options(bt410_l4 PRIVATE ${BT_OPTS})
|
||||
#===========================================================================#
|
||||
# Executable: btl4.exe (WinMain launcher + game lib + engine lib + D3D9/audio)
|
||||
#===========================================================================#
|
||||
# Version stamp: 4.11.<git commit count> (<short hash>[+]) regenerated every
|
||||
# build into ${CMAKE_BINARY_DIR}/btversion.h (see tools/btversion.cmake).
|
||||
add_custom_target(btversion
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DOUT=${CMAKE_BINARY_DIR}/btversion.h
|
||||
-DSRC=${CMAKE_SOURCE_DIR}
|
||||
-P ${CMAKE_SOURCE_DIR}/tools/btversion.cmake
|
||||
BYPRODUCTS ${CMAKE_BINARY_DIR}/btversion.h
|
||||
COMMENT "Stamping btversion.h")
|
||||
add_executable(btl4 WIN32 "${CMAKE_SOURCE_DIR}/game/btl4main.cpp")
|
||||
add_dependencies(btl4 btversion)
|
||||
target_include_directories(btl4 BEFORE PRIVATE
|
||||
"${CMAKE_BINARY_DIR}"
|
||||
"${CMAKE_SOURCE_DIR}/engine/shim"
|
||||
"${CMAKE_SOURCE_DIR}/game/reconstructed"
|
||||
"${CMAKE_SOURCE_DIR}/game/original/BT"
|
||||
|
||||
@@ -12,6 +12,16 @@ the raw archive dumps. It builds and runs out of the box.
|
||||
> **License:** the game content (`content/`) and the original binary are proprietary to Virtual
|
||||
> World / the pod owner. This repository is **private**; do not redistribute.
|
||||
|
||||
## Versioning
|
||||
|
||||
`4.10` = the 1995 arcade release. `4.11` = this win32 reconstruction. Dev builds are
|
||||
**`4.11.<build>` where `<build>` is the git commit count** — monotonic and zero-maintenance —
|
||||
plus the short commit hash (`4.11.311 (980c9cd)`); a trailing `+` on the hash means the exe was
|
||||
built from an uncommitted working tree. The stamp regenerates every build
|
||||
(`tools/btversion.cmake` → `build/btversion.h`) and shows in the boot banner (`btl4.log` line 2)
|
||||
and the window title. To identify any player's build, ask for the title bar or the top of their
|
||||
`btl4.log`.
|
||||
|
||||
---
|
||||
|
||||
## Layout
|
||||
|
||||
@@ -64,6 +64,13 @@ to a frozen abort dialog: `cdb -p <pid> -c ".lines;~*kp 30;q"`. [T2]
|
||||
- **`docs/`** — the detailed ledgers (incl. `PROGRESS_LOG.md`, the full pre-restructure CLAUDE.md).
|
||||
- **`tools/`** — btconsole.py, disas2.py, map/res scanners. **`context/`** — this knowledge base.
|
||||
|
||||
## Versioning (2026-07-18)
|
||||
`4.10` = the 1995 arcade release; `4.11` = this win32 reconstruction; dev builds =
|
||||
**`4.11.<git commit count>` + short hash**, `+` suffix = built from an uncommitted tree
|
||||
(e.g. `4.11.311 (980c9cd+)`). Stamped every build by `tools/btversion.cmake` →
|
||||
`build/btversion.h` (`BT_VERSION_*` macros); shown in the boot banner (btl4.log head) and
|
||||
the window title. Ask a tester for their title bar / btl4.log head to identify a build.
|
||||
|
||||
## Key Relationships
|
||||
- Base: [[wintesla-port]] (the engine build recipe).
|
||||
- Verify loop: [[reconstruction-method]]; env gates: [[decomp-reference]] §6.
|
||||
|
||||
+9
-3
@@ -18,6 +18,7 @@
|
||||
// #define BT_HEAPCHECK // enable to validate the heap on every alloc (heap-corruption hunt)
|
||||
#include <windows.h>
|
||||
#include <shellapi.h> // CommandLineToArgvW
|
||||
#include <btversion.h> // generated: 4.11.<commit count> (<hash>)
|
||||
#include <crtdbg.h> // _CrtSetDbgFlag (heap validation, gated by BT_HEAPCHECK)
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
@@ -326,7 +327,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
std::cout << "BattleTech v4.10 (reconstructed port)" << std::endl << std::flush;
|
||||
// Version scheme: 4.10 = the 1995 arcade release; 4.11 = this win32
|
||||
// reconstruction; build = git commit count, hash pins exact source
|
||||
// ('+' = built from an uncommitted tree). Stamped by tools/btversion.cmake.
|
||||
std::cout << "BattleTech " << BT_VERSION_FULL
|
||||
<< " (win32 reconstruction of Tesla 4.10)" << std::endl << std::flush;
|
||||
|
||||
// CPU pin (timing stability). BT_AFFINITY overrides the mask; =0 disables --
|
||||
// required for multi-instance runs (two instances pinned to core 0 starve
|
||||
@@ -428,9 +433,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
if (np != 0)
|
||||
sscanf(np + 4, " %d", &netPort);
|
||||
if (netPort > 0)
|
||||
swprintf(winTitle, 64, L"BattleTech \x2014 node %d", netPort);
|
||||
swprintf(winTitle, 64, L"BattleTech %S \x2014 node %d",
|
||||
BT_VERSION_STRING, netPort);
|
||||
else
|
||||
wcscpy(winTitle, L"BattleTech");
|
||||
swprintf(winTitle, 64, L"BattleTech %S", BT_VERSION_STRING);
|
||||
}
|
||||
hWnd = CreateWindowEx(0, L"MainWndClass", winTitle, WS_OVERLAPPEDWINDOW,
|
||||
0, 0, wr.right - wr.left, wr.bottom - wr.top,
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# btversion.cmake -- generate btversion.h from git at BUILD time.
|
||||
#
|
||||
# Version scheme (2026-07-18): the arcade release is 4.10; the win32
|
||||
# reconstruction is 4.11; the BUILD number is the git commit count --
|
||||
# monotonic, zero-maintenance, and any build pins to exact source via the
|
||||
# hash. A '+' suffix marks an uncommitted working tree.
|
||||
#
|
||||
# Invoked: cmake -DOUT=<header> -DSRC=<repo root> -P btversion.cmake
|
||||
|
||||
execute_process(COMMAND git rev-list --count HEAD
|
||||
WORKING_DIRECTORY "${SRC}"
|
||||
OUTPUT_VARIABLE BT_BUILD OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
execute_process(COMMAND git rev-parse --short HEAD
|
||||
WORKING_DIRECTORY "${SRC}"
|
||||
OUTPUT_VARIABLE BT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
execute_process(COMMAND git status --porcelain --untracked-files=no
|
||||
WORKING_DIRECTORY "${SRC}"
|
||||
OUTPUT_VARIABLE BT_DIRTY_RAW
|
||||
ERROR_QUIET)
|
||||
|
||||
if(NOT BT_BUILD)
|
||||
set(BT_BUILD 0)
|
||||
endif()
|
||||
if(NOT BT_HASH)
|
||||
set(BT_HASH "nogit")
|
||||
endif()
|
||||
if(BT_DIRTY_RAW STREQUAL "")
|
||||
set(BT_DIRTY "")
|
||||
else()
|
||||
set(BT_DIRTY "+")
|
||||
endif()
|
||||
|
||||
set(CONTENT "// generated by tools/btversion.cmake -- do not edit, not in git
|
||||
#define BT_VERSION_MAJOR 4
|
||||
#define BT_VERSION_MINOR 11
|
||||
#define BT_VERSION_BUILD ${BT_BUILD}
|
||||
#define BT_VERSION_STRING \"4.11.${BT_BUILD}\"
|
||||
#define BT_VERSION_HASH \"${BT_HASH}${BT_DIRTY}\"
|
||||
#define BT_VERSION_FULL \"4.11.${BT_BUILD} (${BT_HASH}${BT_DIRTY})\"
|
||||
")
|
||||
|
||||
# write only when changed so incremental builds don't churn
|
||||
if(EXISTS "${OUT}")
|
||||
file(READ "${OUT}" OLD)
|
||||
else()
|
||||
set(OLD "")
|
||||
endif()
|
||||
if(NOT OLD STREQUAL CONTENT)
|
||||
file(WRITE "${OUT}" "${CONTENT}")
|
||||
endif()
|
||||
Reference in New Issue
Block a user