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>
152 lines
4.9 KiB
C
152 lines
4.9 KiB
C
#pragma once
|
|
|
|
#if DEBUG_LEVEL >= 3
|
|
#undef USE_ACTIVE_PROFILE // Disables trace activity
|
|
#define USE_TIME_ANALYSIS // Enables trace time statistics
|
|
#undef USE_TRACE_LOG // Disables logging functions
|
|
#define USE_FPU_ANALYSIS // Enables entity FPU checks
|
|
#define USE_MEMORY_ANALYSIS // Enables heap statistics
|
|
#undef USE_EVENT_STATISTICS // Disables event statistics
|
|
#elif DEBUG_LEVEL == 2
|
|
#undef USE_ACTIVE_PROFILE // Disables trace activity
|
|
#define USE_TIME_ANALYSIS // Enables trace time statistics
|
|
#undef USE_TRACE_LOG // Disables logging functions
|
|
#define USE_FPU_ANALYSIS // Enables entity FPU checks
|
|
#define USE_MEMORY_ANALYSIS // Enables heap statistics
|
|
#undef USE_EVENT_STATISTICS // Disables event statistics
|
|
#elif DEBUG_LEVEL == 1
|
|
#undef USE_ACTIVE_PROFILE // Disables trace activity
|
|
#define USE_TIME_ANALYSIS // Enables trace time statistics
|
|
#undef USE_TRACE_LOG // Disables logging functions
|
|
#define USE_FPU_ANALYSIS // Enables entity FPU checks
|
|
#define USE_MEMORY_ANALYSIS // Enables heap statistics
|
|
#undef USE_EVENT_STATISTICS // Disables event statistics
|
|
#elif DEBUG_LEVEL == 0
|
|
#if defined(LAB_ONLY)
|
|
#undef USE_ACTIVE_PROFILE // Disables trace activity
|
|
#define USE_TIME_ANALYSIS // Enables trace time statistics
|
|
#define USE_TRACE_LOG // Enables logging functions
|
|
#undef USE_FPU_ANALYSIS // Disables entity FPU checks
|
|
#undef USE_MEMORY_ANALYSIS // Disables heap statistics
|
|
#define USE_EVENT_STATISTICS // Enables event statistics
|
|
#else
|
|
#undef USE_ACTIVE_PROFILE // Disables trace activity
|
|
#undef USE_TIME_ANALYSIS // Disables trace time statistics
|
|
#undef USE_TRACE_LOG // Disables logging functions
|
|
#undef USE_FPU_ANALYSIS // Disables entity FPU checks
|
|
#undef USE_MEMORY_ANALYSIS // Disables heap statistics
|
|
#undef USE_EVENT_STATISTICS // Disables event statistics
|
|
#endif
|
|
#endif
|
|
|
|
#if defined(USE_TIME_ANALYSIS) || defined(USE_ACTIVE_PROFILE) || defined(USE_TRACE_LOG)
|
|
#define TRACE_ON
|
|
#endif
|
|
|
|
//
|
|
// Traces are expensive, release build should not have them
|
|
//
|
|
#if defined(TRACE_ON) && defined(LAB_ONLY)
|
|
|
|
#define TRACE_FOREGROUND_PROCESSING
|
|
// #define TRACE_RENDERER_MANAGER
|
|
// #define TRACE_PROCESS_EVENT
|
|
#define TRACE_EVENT_COUNT
|
|
|
|
//
|
|
// Update Manager Group
|
|
//
|
|
|
|
// #define TRACE_UPDATE_MANAGER
|
|
// #define TRACE_UPDATE_MASTER
|
|
// #define TRACE_UPDATE_REPLICANTS
|
|
|
|
//
|
|
// Networking Group
|
|
//
|
|
|
|
// #define TRACE_SEND_PACKET
|
|
// #define TRACE_ROUTE_PACKET
|
|
// #define TRACE_LOST_DATA
|
|
// #define TRACE_SEND_BUFFER
|
|
//
|
|
// Video Renderer group
|
|
// To see all the video renderer traces seperately, DO NOT define USE_ONE_VIDEO_TRACE
|
|
// To see all of the video renderer on the same trace, enable the following:
|
|
//
|
|
// USE_ONE_VIDEO_TRACE
|
|
// TRACE_VIDEO_RENDERER
|
|
// TRACE_VIDEO_BECOME_INTERESTING
|
|
// TRACE_VIDEO_BECOME_UNINTERESTING
|
|
// TRACE_VIDEO_RENDERER_FRAME_DONE
|
|
//
|
|
// The time used by the above four traces will all appear on the video renderer
|
|
// trace together. This configuration should not cause any buzzing of traces and
|
|
// should capture 100% of the video renderer's activity.
|
|
// Other video renderer traces may be enabled but will appear seperately
|
|
//
|
|
// CAUTION: Depending on the setup, TRACE_VIDEO_RENDERABLES can buzz, severly
|
|
// lengthening the video renderer profile times. Use carefully.
|
|
//
|
|
// #define USE_ONE_VIDEO_TRACE
|
|
// #define TRACE_VIDEO_RENDERER
|
|
// #define TRACE_VIDEO_BECOME_INTERESTING
|
|
// #define TRACE_VIDEO_BECOME_UNINTERESTING
|
|
// #define TRACE_VIDEO_RENDERER_FRAME_DONE
|
|
|
|
// #define TRACE_VIDEO_CULL_SETUP
|
|
// #define TRACE_VIDEO_VEHICLE_RENDERABLES
|
|
// #define TRACE_VIDEO_ALL_RENDERABLES
|
|
// #define TRACE_VIDEO_MECH_CULL_RENDERABLE
|
|
// #define TRACE_VIDEO_BATCH_FLUSH
|
|
// #define TRACE_VIDEO_LOAD_OBJECT
|
|
// #define TRACE_VIDEO_PICKPOINT
|
|
// #define TRACE_VIDEO_RENDERABLES
|
|
// #define TRACE_VIDEO_CONSTRUCT_ROOT // construct the root of
|
|
// #define TRACE_VIDEO_FIRST_FRAME_DONE // obsolete soon
|
|
|
|
//
|
|
// Audio renderer group
|
|
//
|
|
|
|
// #define TRACE_AUDIO_RENDERER
|
|
// #define TRACE_AUDIO_RENDERER_MIDI
|
|
// #define TRACE_AUDIO_RENDERER_CREATE_OBJECTS
|
|
// #define TRACE_AUDIO_RENDERER_DESTROY_OBJECTS
|
|
// #define TRACE_AUDIO_RENDERER_START_HANDLER
|
|
// #define TRACE_AUDIO_RENDERER_STOP_HANDLER
|
|
// #define TRACE_AUDIO_RENDERER_EXECUTE
|
|
// #define TRACE_AUDIO_RENDERER_RUNNING_SOURCES
|
|
// #define TRACE_AUDIO_RENDERER_RUNNING_SORT
|
|
// #define TRACE_AUDIO_RENDERER_CALCULATE_MIX
|
|
// #define TRACE_AUDIO_RENDERER_EXECUTE_SOURCES
|
|
// #define TRACE_AUDIO_RENDERER_DORMANT_SOURCES
|
|
|
|
//
|
|
// Gauge renderer group
|
|
//
|
|
|
|
// #define TRACE_GAUGE_RENDERER
|
|
// #define TRACE_SCREEN_COPY
|
|
|
|
//
|
|
// Other leftovers, these are probably obsolete, if you know ones that are, kill
|
|
// kill them off as appropriate.
|
|
//
|
|
|
|
#if 0
|
|
#define TRACE_COMPLETE_CYCLES
|
|
#define TRACE_DEATH_ROW
|
|
|
|
#define TRACE_EXECUTE_ENTITY
|
|
#define TRACE_PERFORM_ENTITY
|
|
#define TRACE_PERFORM_SUBSYSTEMS
|
|
#define TRACE_EXECUTE_WATCHERS
|
|
|
|
#define TRACE_RIO_RECEIVE_PACKET
|
|
#define TRACE_RIO_SEND_PACKET
|
|
#define TRACE_CHECK_BUFFERS
|
|
#define TRACE_CALL_NETNUB
|
|
#endif
|
|
#endif
|