Files
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

123 lines
3.9 KiB
C++

/*
* PROJECT:
* SUBSYSTEM:
* MODULE:
*
* FILE: $RCSfile: parser.h,v $
* REVISION: $Revision: 1.8 $
* Date: $Date: 1995/05/18 09:41:31 $
* Author: $Author: jeff $
* RCS Ident: $Id: parser.h,v 1.8 1995/05/18 09:41:31 jeff beta $
*
* FUNCTION:
*
* Copyright (c) 1994 Division Ltd.
*
* All Rights Reserved.
*
* This Document may not, in whole or in part, be copied,
* photocopied, reproduced, translated, or reduced to any
* electronic medium or machine readable form without prior
* written consent from Division Ltd.
*/
#ifndef _PARSER_H
#define _PARSER_H
#ifdef __cplusplus
extern "C" {
#endif
#define PARSER_MAX_TOKEN_SIZE 2048
#define PARSER_MATCH_CASE 0
#define PARSER_ANY_CASE 1
/*
* macros for testing char classes
*/
#define PARSER_LEX_START 1
#define PARSER_LEX_CONTINUE 2
#define parserStartChar(f,x) ((f)->LexClass[(x)] & PARSER_LEX_START )
#define parserContinueChar(f,x) ((f)->LexClass[(x)] & PARSER_LEX_CONTINUE )
/*
* tokens returned by parser functions
*/
#define PARSER_OK 0
#define PARSER_ERR -1
#define PARSER_EOF -2
#define PARSER_STRING -3
#define PARSER_INT -4
#define PARSER_FLOAT -5
#define PARSER_PUSH -6
#define PARSER_POP -7
#define PARSER_QUOTED_STRING -8
/*
* used to hold pre-processing state info.
* Contents are not made public.
*/
typedef struct pprocState pprocState;
typedef struct dParseKeyTab
{
int tok;
char *name;
int matchCase;
} dParseKeyTab;
typedef struct dParseFile
{
int errorFlag;
int seeIncludes;
int pushedBackToken;
float fpNumber;
long iNumber;
char *buffer;
int bufSize;
int bufPos;
dParseKeyTab *keyTab;
int charNo;
pprocState *ppstate;
char LexClass[128];
} dParseFile, *dParseFilePtr;
extern void parserVersion(FILE *openfp);
extern dParseFilePtr parserCreate(char *name,
FILE *openfp,
dParseKeyTab *keyTable,
int bufferSize,
FILE *(*fileFinder)(const char *),
const char *startChars,
const char *continueChars,
int seeIncludes);
extern void parserDestroy(dParseFilePtr fptr);
extern dParseFilePtr parserOpenFile(char *name,
FILE *fp,
dParseKeyTab *keyTable,
int bufferSize,
FILE *(*fileFinder)(const char *),
const char *startChars,
const char *continueChars,
int seeIncludes);
extern void parserCloseFile(dParseFilePtr fPtr);
extern int parserGetc(dParseFilePtr fptr);
extern int parserUngetc(dParseFilePtr fptr, char c);
extern char *parserTokenToString(dParseFilePtr fptr, const int token);
extern int parserPushToken(dParseFilePtr fptr, const int token);
extern int parserNextToken(dParseFilePtr fptr);
extern char *parserMatchString(dParseFilePtr fptr);
extern int parserMatchInt(dParseFilePtr fptr, int *num);
extern int parserMatchFloat(dParseFilePtr fptr, float *num);
extern int parserMatchCharacter(dParseFilePtr fptr, char c);
extern const char *parserCurrentFile(dParseFilePtr fptr);
extern int parserCurrentLine(dParseFilePtr fptr);
#ifdef __cplusplus
}
#endif
#endif