- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
104 lines
3.6 KiB
C++
104 lines
3.6 KiB
C++
/*------------------------------------------------------------------------
|
|
* filename - _startup.h
|
|
*
|
|
* definitions used by startup code for EXEs and DLLs
|
|
*
|
|
*-----------------------------------------------------------------------*/
|
|
|
|
/*
|
|
* C/C++ Run Time Library - Version 1.5
|
|
*
|
|
* Copyright (c) 1991, 1994 by Borland International
|
|
* All Rights Reserved.
|
|
*
|
|
*/
|
|
|
|
#if !defined( __DEFS_H )
|
|
#include <_defs.h>
|
|
#endif
|
|
|
|
/*----------------------------------------------------------------------
|
|
* Structure of records in the _INIT_ segment.
|
|
*/
|
|
typedef void (*VOIDFUNC)(void); /* pointer to void function */
|
|
|
|
#define NULLFUNC ((VOIDFUNC)0)
|
|
|
|
#pragma pack(2)
|
|
|
|
typedef struct init
|
|
{
|
|
char reserved; /* reserved, must be zero */
|
|
unsigned char priority; /* 0 = high, ff = low */
|
|
VOIDFUNC func; /* init function */
|
|
#ifdef MSLINK
|
|
char filler[10]; /* NT linker aligns on 16-byte boundaries */
|
|
#endif
|
|
} INIT;
|
|
|
|
#pragma pack()
|
|
|
|
/*----------------------------------------------------------------------
|
|
* Structure containing an individual module's initialization
|
|
* and cleanup information. The actual structure is located
|
|
* in the startup module C02 or C02D. The startup module passes
|
|
* a pointer to the structure to _startup() (EXE) and _startupd() (DLL).
|
|
*/
|
|
typedef struct module_data
|
|
{
|
|
INIT *init_start; /* start of a module's _INIT_ segment */
|
|
INIT *init_end; /* end of a module's _INIT_ segment */
|
|
INIT *exit_start; /* start of a module's _EXIT_ segment */
|
|
INIT *exit_end; /* end of a module's _EXIT_ segment */
|
|
int flags; /* flags (see below) */
|
|
int hmod; /* module handle */
|
|
int (*main)(); /* main/WinMain/_dllmain function */
|
|
int (*matherr)(void *); /* (EXE only) _matherr function */
|
|
int (*matherrl)(void *); /* (EXE only) _matherrl function */
|
|
long stackbase; /* (EXE only) base of stack */
|
|
int *fmode; /* (EXE only) address of _fmode variable */
|
|
} MODULE_DATA;
|
|
|
|
/* MODULE_DATA flags.
|
|
*/
|
|
#define MF_WINDOWS 1 /* this is a Windows application */
|
|
|
|
/*----------------------------------------------------------------------
|
|
* Structure of a multiple _INIT_ table. In a multi-dll application,
|
|
* this will be located in a shared memory region, and will contain
|
|
* pointers to each DLL's module data structure.
|
|
*/
|
|
typedef struct multi_init
|
|
{
|
|
int ntables; /* actual number of entries in table[] */
|
|
MODULE_DATA *table[1]; /* pointer(s) to module table */
|
|
} MULTI_INIT;
|
|
|
|
/*----------------------------------------------------------------------
|
|
* External variables in startup.c.
|
|
*/
|
|
extern MULTI_INIT _dll_table; /* DLL's init table */
|
|
|
|
/*----------------------------------------------------------------------
|
|
* _multidll is a flag that says whether this is a DLL that is part
|
|
* of a multiple-DLL application. If the flag is set, the DLL startup
|
|
* code does not call the _INIT_ functions, but simply saves a pointer
|
|
* the _INIT_ segment in shared memory region. Later on, the EXE
|
|
* using the DLLs will call the initialization functions.
|
|
*/
|
|
extern int _multidll;
|
|
|
|
/*----------------------------------------------------------------------
|
|
* External functions in startup.c
|
|
*/
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
VOIDFUNC _init_exit_proc (MULTI_INIT *init_table, int __is_exit);
|
|
MULTI_INIT * _create_shmem (void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|