Files
BT412/game/original/BT_L4/BTL4MODE.CPP
T
arcattackandClaude Opus 4.8 7b7d465e5e Initial commit: bt411 -- standalone Windows BattleTech (Tesla 4.10 port)
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>
2026-07-05 21:03:40 -05:00

105 lines
3.8 KiB
C++

//==========================================================================//
// File: BTMODE.CPP //
// Project: MUNGA Brick: Controls Manager //
// Contents: Interface specification for BT LBE4 Controls //
//--------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ----------------------------------------------------------//
// 02/13/96 CPB Built from CONTROLS.CPP //
//--------------------------------------------------------------------------//
// Copyright (C) 1994-1996, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//==========================================================================//
#include <btl4.hpp>
#pragma hdrstop
#if !defined(BTL4MODE_HPP)
# include <btl4mode.hpp>
#endif
#if defined(DEBUG)
# define Test_Tell(n) DEBUG_STREAM << n
#else
# define Test_Tell(n)
#endif
struct ModeLookup
{
const char *name;
ModeMask modeMask;
};
static ModeLookup
mode_lookup[] =
{
{"ModeMFD1Quad", BTL4ModeManager::ModeMFD1Quad},
{"ModeMFD1Eng1", BTL4ModeManager::ModeMFD1Eng1},
{"ModeMFD1Eng2", BTL4ModeManager::ModeMFD1Eng2},
{"ModeMFD1Eng3", BTL4ModeManager::ModeMFD1Eng3},
{"ModeMFD1Eng4", BTL4ModeManager::ModeMFD1Eng4},
{"ModeMFD2Quad", BTL4ModeManager::ModeMFD2Quad},
{"ModeMFD2Eng1", BTL4ModeManager::ModeMFD2Eng1},
{"ModeMFD2Eng2", BTL4ModeManager::ModeMFD2Eng2},
{"ModeMFD2Eng3", BTL4ModeManager::ModeMFD2Eng3},
{"ModeMFD2Eng4", BTL4ModeManager::ModeMFD2Eng4},
{"ModeMFD3Quad", BTL4ModeManager::ModeMFD3Quad},
{"ModeMFD3Eng1", BTL4ModeManager::ModeMFD3Eng1},
{"ModeMFD3Eng2", BTL4ModeManager::ModeMFD3Eng2},
{"ModeMFD3Eng3", BTL4ModeManager::ModeMFD3Eng3},
{"ModeMFD3Eng4", BTL4ModeManager::ModeMFD3Eng4},
{"ModeMapping", BTL4ModeManager::ModeMapping},
{"ModeNonMapping", BTL4ModeManager::ModeNonMapping},
{"ModeIntercom", BTL4ModeManager::ModeIntercom},
{"ModeSecondaryDamage", BTL4ModeManager::ModeSecondaryDamage},
{"ModeSecondaryCritical", BTL4ModeManager::ModeSecondaryCritical},
{"ModeSecondaryHeat", BTL4ModeManager::ModeSecondaryHeat},
{"ModeEject", BTL4ModeManager::ModeEject},
{"ModePlasmaDisplay", BTL4ModeManager::ModePlasmaDisplay},
{"ModeInitial", BTL4ModeManager::ModeInitial},
{"ModeNonConfig", BTL4ModeManager::ModeNonConfig},
{"ModeMFD1NonQuad", BTL4ModeManager::ModeMFD1NonQuad},
{"ModeMFD1All", BTL4ModeManager::ModeMFD1All},
{"ModeMFD2NonQuad", BTL4ModeManager::ModeMFD2NonQuad},
{"ModeMFD2All", BTL4ModeManager::ModeMFD2All},
{"ModeMFD3NonQuad", BTL4ModeManager::ModeMFD3NonQuad},
{"ModeMFD3All", BTL4ModeManager::ModeMFD3All},
{"ModeSecondaryAll", BTL4ModeManager::ModeSecondaryAll},
{ NULL, (ModeMask)0}
};
Logical
BTL4ModeManager::ModeStringLookup(
const char *name,
ModeMask *returned_value
)
{
Check(this);
Check_Pointer(name);
Check_Pointer(returned_value);
//----------------------------------------
// Search table for match
//----------------------------------------
ModeLookup
*lookup;
for(lookup=mode_lookup; lookup->name!=NULL; ++lookup)
{
if (stricmp(name, lookup->name) == 0)
{
*returned_value = lookup->modeMask;
Check_Fpu();
return True;
}
}
//----------------------------------------
// Not found here, check next level down.
//----------------------------------------
Check_Fpu();
return ModeManager::ModeStringLookup(name, returned_value);
}