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>
139 lines
4.8 KiB
C
139 lines
4.8 KiB
C
#pragma once
|
|
|
|
#include "..\munga\style.h"
|
|
|
|
#define VK_MASK 0x00FF
|
|
#define CTRL_BIT 0x0100
|
|
#define ALT_BIT 0x0200
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Handy keycode definitions
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ESC VK_ESCAPE // "escape" key
|
|
# define PCK_ENTER VK_RETURN // the ever-popular "enter" key
|
|
# define PCK_TAB VK_TAB // the obvious "tab" key
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: function keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_F1 VK_F1
|
|
# define PCK_F2 VK_F2
|
|
# define PCK_F3 VK_F3
|
|
# define PCK_F4 VK_F4
|
|
# define PCK_F5 VK_F5
|
|
# define PCK_F6 VK_F6
|
|
# define PCK_F7 VK_F7
|
|
# define PCK_F8 VK_F8
|
|
# define PCK_F9 VK_F9
|
|
# define PCK_F10 VK_F10
|
|
# define PCK_F11 VK_F11
|
|
# define PCK_F12 VK_F12
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: ctrl-function keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_CTL_F1 (CTRL_BIT | VK_F1)
|
|
# define PCK_CTL_F2 (CTRL_BIT | VK_F2)
|
|
# define PCK_CTL_F3 (CTRL_BIT | VK_F3)
|
|
# define PCK_CTL_F4 (CTRL_BIT | VK_F4)
|
|
# define PCK_CTL_F5 (CTRL_BIT | VK_F5)
|
|
# define PCK_CTL_F6 (CTRL_BIT | VK_F6)
|
|
# define PCK_CTL_F7 (CTRL_BIT | VK_F7)
|
|
# define PCK_CTL_F8 (CTRL_BIT | VK_F8)
|
|
# define PCK_CTL_F9 (CTRL_BIT | VK_F9)
|
|
# define PCK_CTL_F10 (CTRL_BIT | VK_F10)
|
|
# define PCK_CTL_F11 (CTRL_BIT | VK_F11)
|
|
# define PCK_CTL_F12 (CTRL_BIT | VK_F12)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: alt-function keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ALT_F1 (ALT_BIT | VK_F1)
|
|
# define PCK_ALT_F2 (ALT_BIT | VK_F2)
|
|
# define PCK_ALT_F3 (ALT_BIT | VK_F3)
|
|
# define PCK_ALT_F4 (ALT_BIT | VK_F4)
|
|
# define PCK_ALT_F5 (ALT_BIT | VK_F5)
|
|
# define PCK_ALT_F6 (ALT_BIT | VK_F6)
|
|
# define PCK_ALT_F7 (ALT_BIT | VK_F7)
|
|
# define PCK_ALT_F8 (ALT_BIT | VK_F8)
|
|
# define PCK_ALT_F9 (ALT_BIT | VK_F9)
|
|
# define PCK_ALT_F10 (ALT_BIT | VK_F10)
|
|
# define PCK_ALT_F11 (ALT_BIT | VK_F11)
|
|
# define PCK_ALT_F12 (ALT_BIT | VK_F12)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: cursor keys (numeric keypad WITH NUMLOCK OFF!)
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_INS VK_INSERT
|
|
# define PCK_DEL VK_DELETE
|
|
# define PCK_HOME VK_HOME
|
|
# define PCK_UP VK_UP
|
|
# define PCK_PGUP VK_PRIOR
|
|
# define PCK_LEFT VK_LEFT
|
|
# define PCK_RIGHT VK_RIGHT
|
|
# define PCK_END VK_END
|
|
# define PCK_DOWN VK_DOWN
|
|
# define PCK_PGDN VK_NEXT
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: ctrl-cursor keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_CTL_INS (CTRL_BIT | VK_INSERT)
|
|
# define PCK_CTL_DEL (CTRL_BIT | VK_DELETE)
|
|
# define PCK_CTL_HOME (CTRL_BIT | VK_HOME)
|
|
# define PCK_CTL_UP (CTRL_BIT | VK_UP)
|
|
# define PCK_CTL_PGUP (CTRL_BIT | VK_PRIOR)
|
|
# define PCK_CTL_LEFT (CTRL_BIT | VK_LEFT)
|
|
# define PCK_CTL_RIGHT (CTRL_BIT | VK_RIGHT)
|
|
# define PCK_CTL_END (CTRL_BIT | VK_END)
|
|
# define PCK_CTL_DOWN (CTRL_BIT | VK_DOWN)
|
|
# define PCK_CTL_PGDN (CTRL_BIT | VK_NEXT)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: alt-cursor keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ALT_INS (ALT_BIT | VK_INSERT)
|
|
# define PCK_ALT_DEL (ALT_BIT | VK_DELETE)
|
|
# define PCK_ALT_HOME (ALT_BIT | VK_HOME)
|
|
# define PCK_ALT_UP (ALT_BIT | VK_UP)
|
|
# define PCK_ALT_PGUP (ALT_BIT | VK_PRIOR)
|
|
# define PCK_ALT_LEFT (ALT_BIT | VK_LEFT)
|
|
# define PCK_ALT_RIGHT (ALT_BIT | VK_RIGHT)
|
|
# define PCK_ALT_END (ALT_BIT | VK_END)
|
|
# define PCK_ALT_DOWN (ALT_BIT | VK_DOWN)
|
|
# define PCK_ALT_PGDN (ALT_BIT | VK_NEXT)
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: alt-keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_ALT_W (ALT_BIT | 'W')
|
|
# define PCK_ALT_R (ALT_BIT | 'R')
|
|
# define PCK_ALT_P (ALT_BIT | 'P')
|
|
# define PCK_ALT_F (ALT_BIT | 'F')
|
|
# define PCK_ALT_K (ALT_BIT | 'K')
|
|
# define PCK_ALT_V (ALT_BIT | 'V')
|
|
# define PCK_ALT_SLASH (ALT_BIT | VK_OEM_2) // '/?' key
|
|
|
|
//
|
|
//----------------------------------------------------------------
|
|
// Extended keycodes: ctrl-keys
|
|
//----------------------------------------------------------------
|
|
//
|
|
# define PCK_CTRL_W (CTRL_BIT | 'W')
|
|
# define PCK_CTRL_R (CTRL_BIT | 'R')
|
|
# define PCK_CTRL_P (CTRL_BIT | 'P')
|
|
# define PCK_CTRL_F (CTRL_BIT | 'F')
|
|
# define PCK_CTRL_K (CTRL_BIT | 'K')
|
|
# define PCK_CTRL_V (CTRL_BIT | 'V')
|
|
# define PCK_CTRL_SLASH (CTRL_BIT | VK_OEM_2) // '/?' key
|
|
|
|
extern int PC_Keyboard_Read(void); // returns code or zero if no key
|