- Launcher (sacred_re.exe) starts sacred.exe with sacred_re.dll injected via Detours; the DLL verifies the Sacred Gold 2.28 build before hooking. - Hook framework: RE_HOOK for game addresses, RE_HOOK_API for Windows APIs, per-hook enable/disable in sacred_re.ini, sacred_re.log. - Game code: Log (0x66f1c0) hooked, CmdLineHasFlag (0x813140) rewritten. - Borderless mod: forces windowed mode, covers the monitor, scales the 1024x768 image aspect-correct, remaps mouse input, keeps running in the background with keyboard input hidden while unfocused. - CMake/Ninja/MSVC x86 build, VS Code setup, disasm tool, function map. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
20 lines
1.1 KiB
PowerShell
20 lines
1.1 KiB
PowerShell
# Configure + build from any shell: enters the x86 MSVC environment first.
|
|
# .\build.ps1 # x86-debug
|
|
# .\build.ps1 x86-release
|
|
param([string]$Preset = "x86-debug")
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
|
|
$vs = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
|
if (-not $vs) { throw "MSVC x86 tools not found (install VS Build Tools with 'Desktop development with C++')." }
|
|
$vcvars = Join-Path $vs "VC\Auxiliary\Build\vcvarsall.bat"
|
|
# vcvarsall itself calls vswhere and expects it on PATH.
|
|
$env:PATH = "$(Split-Path $vswhere);$env:PATH"
|
|
|
|
# Configure only once: the build re-runs CMake itself when needed, and
|
|
# re-configuring here would clash with VS Code's CMake Tools, which caches
|
|
# the full path of cl.exe instead of the preset's plain "cl".
|
|
$configure = if (Test-Path "build\$Preset\CMakeCache.txt") { "" } else { "cmake --preset $Preset && " }
|
|
cmd /c "`"$vcvars`" x86 >nul && $configure cmake --build --preset $Preset"
|
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|