Clean, self-contained extraction of the BattleTech-specific work from the
reverse-engineering workspace -- engine + game + content + build, with nothing
from Red Planet or the raw archive dumps. Builds green (Win32) and runs the
single-player drive->animate->target->fire->damage->destroy loop out of the box.
Layout:
engine/ MUNGA + MUNGA_L4 shared 2007 engine, carrying our BT render/loader
work (bgfload/L4D3D/L4VIDEO: BSL bit-slice decode, LOD/ground/shadow
models) + image codec; the minimal rp/ headers the audio HAL needs
game/ reconstructed BT logic + surviving-original BT source + fwd shims
+ WinMain launcher
content/ full runtime tree (BTL4.RES, VIDEO/, GAUGE/, AUDIO/, eggs, BTDPL.INI)
docs/ format specs + reconstruction ledgers
reference/ raw Ghidra pseudocode (recon source-of-truth) + decomp exporter
tools/ MP console emulator + map/resource scanners
One top-level CMake builds munga_engine lib + bt410_l4 game lib + btl4.exe.
All paths relativized (186 fwd shims + ~437 CMake abs paths -> repo-relative);
DXSDK is the one external, overridable via -DDXSDK. Verified: builds to a
byte-identical 2.27MB exe and runs combat (TARGET DESTROYED, 0 crashes) against
the bundled content.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
72 lines
2.3 KiB
C
72 lines
2.3 KiB
C
// Recovered decompilation of functions attributed to bt/heat.cpp
|
|
// (from BTL4OPT.EXE via embedded assert paths). Pseudocode — reconstruct against the header.
|
|
|
|
/* ---- @ 004adda0 ---- */
|
|
|
|
int * __cdecl
|
|
FUN_004adda0(int *param_1,int param_2,undefined4 param_3,char *param_4,undefined4 param_5,
|
|
int param_6,int param_7)
|
|
|
|
{
|
|
int iVar1;
|
|
int local_8;
|
|
|
|
FUN_004ac644(param_1,param_2,param_3,param_4,param_5,param_6,param_7);
|
|
*param_1 = (int)&PTR_FUN_0050edc4;
|
|
param_1[0x45] = *(int *)(param_4 + 0xe4);
|
|
param_1[0x46] = *(int *)(param_4 + 0xe8);
|
|
param_1[0x47] = *(int *)(param_4 + 0xec);
|
|
param_1[0x48] = 0;
|
|
param_1[0x49] = 0x3f000000;
|
|
param_1[0x4a] = 0x3f800000;
|
|
param_1[0x4b] = param_1[0x4a];
|
|
param_1[0x4c] = 0;
|
|
param_1[0x4d] = 1;
|
|
param_1[0x4e] = 0;
|
|
param_1[0x4f] = param_1[0x45];
|
|
param_1[0x50] = *(int *)(param_4 + 0xf0);
|
|
FUN_0043ad4f((uint *)(param_1 + 0x51),0xf,0);
|
|
param_1[0x54] = 0x3ecccccd;
|
|
param_1[0x55] = *(int *)(param_4 + 0xf4);
|
|
param_1[0x56] = (int)((float)param_1[0x55] * (float)param_1[0x4f]);
|
|
param_1[0x57] = 0x3f800000;
|
|
param_1[0x58] = 0x3f800000;
|
|
FUN_004af9cf(param_1 + 0x59,0);
|
|
FUN_0041b9ec(param_1 + 0x5c,3);
|
|
param_1[0x72] = 0;
|
|
if (((*(uint *)(param_2 + 0x28) & 0xc) == 0) && ((*(uint *)(param_2 + 0x28) & 0x100) != 0)) {
|
|
param_1[7] = (int)PTR_FUN_0050e4e0;
|
|
param_1[8] = DAT_0050e4e4;
|
|
param_1[9] = DAT_0050e4e8;
|
|
}
|
|
param_1[0x71] = (int)param_4;
|
|
local_8 = 0;
|
|
iVar1 = FUN_0041a1a4(*(int *)param_1[3],0x50e590);
|
|
if (iVar1 == 0) {
|
|
if (*(int *)(param_4 + 0xf8) < *(int *)(param_2 + 0x124)) {
|
|
local_8 = *(int *)(*(int *)(param_2 + 0x128) + *(int *)(param_4 + 0xf8) * 4);
|
|
}
|
|
else {
|
|
FUN_0040385c(s_Bad_subsystem_resource_>heatSink_0050e7c9,s_d__tesla_bt_bt_HEAT_CPP_0050e804,
|
|
0x25f);
|
|
}
|
|
if (((*(uint *)(param_2 + 0x28) & 0xc) == 0) && ((*(uint *)(param_2 + 0x28) & 0x100) != 0)) {
|
|
if (local_8 == 0) {
|
|
FUN_0040385c(s_Master_heatable_subystem_is_miss_0050e81c,s_d__tesla_bt_bt_HEAT_CPP_0050e859,
|
|
0x26b);
|
|
}
|
|
else {
|
|
(**(code **)(param_1[0x59] + 4))(param_1 + 0x59,local_8);
|
|
}
|
|
}
|
|
else if (((*(uint *)(param_2 + 0x28) & 0xc) == 4) && (local_8 != 0)) {
|
|
(**(code **)(param_1[0x59] + 4))(param_1 + 0x59,local_8);
|
|
}
|
|
}
|
|
FUN_004ad7f0((int)param_1);
|
|
return param_1;
|
|
}
|
|
|
|
|
|
|