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>
94 lines
3.1 KiB
C
94 lines
3.1 KiB
C
#include <al.h>
|
|
|
|
// X-RAM Function pointer definitions
|
|
typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
|
|
typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Query for X-RAM extension
|
|
//
|
|
// if (alIsExtensionPresent("EAX-RAM") == AL_TRUE)
|
|
// X-RAM Extension found
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// X-RAM enum names
|
|
//
|
|
// "AL_EAX_RAM_SIZE"
|
|
// "AL_EAX_RAM_FREE"
|
|
// "AL_STORAGE_AUTOMATIC"
|
|
// "AL_STORAGE_HARDWARE"
|
|
// "AL_STORAGE_ACCESSIBLE"
|
|
//
|
|
// Query enum values using alGetEnumValue, for example
|
|
//
|
|
// long lRamSizeEnum = alGetEnumValue("AL_EAX_RAM_SIZE")
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Query total amount of X-RAM
|
|
//
|
|
// long lTotalSize = alGetInteger(alGetEnumValue("AL_EAX_RAM_SIZE")
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Query free X-RAM available
|
|
//
|
|
// long lFreeSize = alGetInteger(alGetEnumValue("AL_EAX_RAM_FREE")
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Query X-RAM Function pointers
|
|
//
|
|
// Use typedefs defined above to get the X-RAM function pointers using
|
|
// alGetProcAddress
|
|
//
|
|
// EAXSetBufferMode eaxSetBufferMode;
|
|
// EAXGetBufferMode eaxGetBufferMode;
|
|
//
|
|
// eaxSetBufferMode = (EAXSetBufferMode)alGetProcAddress("EAXSetBufferMode");
|
|
// eaxGetBufferMode = (EAXGetBufferMode)alGetProcAddress("EAXGetBufferMode");
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Force an Open AL Buffer into X-RAM (good for non-streaming buffers)
|
|
//
|
|
// ALuint uiBuffer;
|
|
// alGenBuffers(1, &uiBuffer);
|
|
// eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_HARDWARE"));
|
|
// alBufferData(...);
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Force an Open AL Buffer into 'accessible' (currently host) RAM (good for streaming buffers)
|
|
//
|
|
// ALuint uiBuffer;
|
|
// alGenBuffers(1, &uiBuffer);
|
|
// eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_ACCESSIBLE"));
|
|
// alBufferData(...);
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
// Put an Open AL Buffer into X-RAM if memory is available, otherwise use
|
|
// host RAM. This is the default mode.
|
|
//
|
|
// ALuint uiBuffer;
|
|
// alGenBuffers(1, &uiBuffer);
|
|
// eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_AUTOMATIC"));
|
|
// alBufferData(...);
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////////
|