- 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>
173 lines
6.5 KiB
Plaintext
173 lines
6.5 KiB
Plaintext
##--BEGIN-- @OPT_APPL_HELP
|
|
|
|
|
|
bool [[TApplication]]::ProcessAppMsg (MSG& msg)
|
|
{
|
|
if (msg.message == WM_COMMAND) {
|
|
if (ContextHelp || (::GetKeyState(VK_F1) < 0)) {
|
|
ContextHelp = false;
|
|
GetMainWindow()->WinHelp(HelpFileName, HELP_CONTEXT, msg.wParam);
|
|
return true;
|
|
}
|
|
} else
|
|
switch (msg.message) {
|
|
case WM_KEYDOWN:
|
|
if (msg.wParam == VK_F1) {
|
|
##:@QUERY_APPL_COMMENT == VALUE_VERBOSE
|
|
// If the Shift/F1 then set the help cursor and turn on the modal help state.
|
|
if (::GetKeyState(VK_SHIFT) < 0) {
|
|
ContextHelp = true;
|
|
HelpCursor = ::LoadCursor(GetMainWindow()->GetModule()->GetInstance(), MAKEINTRESOURCE(IDC_HELPCURSOR));
|
|
::SetCursor(HelpCursor);
|
|
return true; // Gobble up the message.
|
|
} else {
|
|
##:@QUERY_APPL_COMMENT == VALUE_VERBOSE
|
|
// If F1 w/o the Shift key then bring up help's main index.
|
|
GetMainWindow()->WinHelp(HelpFileName, HELP_INDEX, 0L);
|
|
return true; // Gobble up the message.
|
|
}
|
|
} else {
|
|
if (ContextHelp && (msg.wParam == VK_ESCAPE)) {
|
|
if (HelpCursor)
|
|
::DestroyCursor(HelpCursor);
|
|
ContextHelp = false;
|
|
HelpCursor = 0;
|
|
GetMainWindow()->SetCursor(0, IDC_ARROW);
|
|
return true; // Gobble up the message.
|
|
}
|
|
}
|
|
break;
|
|
|
|
case WM_MOUSEMOVE:
|
|
case WM_NCMOUSEMOVE:
|
|
if (ContextHelp) {
|
|
::SetCursor(HelpCursor);
|
|
return true; // Gobble up the message.
|
|
}
|
|
break;
|
|
|
|
case WM_INITMENU:
|
|
if (ContextHelp) {
|
|
::SetCursor(HelpCursor);
|
|
return true; // Gobble up the message.
|
|
}
|
|
break;
|
|
|
|
case WM_ENTERIDLE:
|
|
if (msg.wParam == MSGF_MENU)
|
|
if (GetKeyState(VK_F1) < 0) {
|
|
ContextHelp = true;
|
|
GetMainWindow()->PostMessage(WM_KEYDOWN, VK_RETURN, 0L);
|
|
return true; // Gobble up the message.
|
|
}
|
|
break;
|
|
|
|
default:
|
|
;
|
|
}; // End of switch
|
|
|
|
// Continue normal processing.
|
|
|
|
return TApplication::ProcessAppMsg(msg);
|
|
}
|
|
|
|
|
|
##--END-- @OPT_APPL_HELP
|
|
##--BEGIN-- @OPT_APPL_PRINTING
|
|
void [[TApplication]]::EvWinIniChange (char far* section)
|
|
{
|
|
if (strcmp(section, "windows") == 0) {
|
|
##--BEGIN-- @QUERY_APPL_COMMENT == VALUE_VERBOSE
|
|
// If the device changed in the WIN.INI file then the printer
|
|
// might have changed. If we have a TPrinter (Printer) then
|
|
// check and make sure it's identical to the current device
|
|
// entry in WIN.INI.
|
|
##--END-- @QUERY_APPL_COMMENT == VALUE_VERBOSE
|
|
if (Printer) {
|
|
char printDBuffer[255];
|
|
LPSTR printDevice = printDBuffer;
|
|
LPSTR devName;
|
|
LPSTR driverName = 0;
|
|
LPSTR outputName = 0;
|
|
|
|
if (::GetProfileString("windows", "device", "", printDevice, sizeof(printDevice))) {
|
|
##--BEGIN-- @QUERY_APPL_COMMENT == VALUE_VERBOSE
|
|
// The string which should come back is something like:
|
|
//
|
|
// HP LaserJet III,hppcl5a,LPT1:
|
|
//
|
|
// Where the format is:
|
|
//
|
|
// devName,driverName,outputName
|
|
//
|
|
##--END-- @QUERY_APPL_COMMENT == VALUE_VERBOSE
|
|
devName = printDevice;
|
|
while (*printDevice) {
|
|
if (*printDevice == ',') {
|
|
*printDevice++ = 0;
|
|
if (!driverName)
|
|
driverName = printDevice;
|
|
else
|
|
outputName = printDevice;
|
|
} else
|
|
printDevice = ::AnsiNext(printDevice);
|
|
}
|
|
|
|
if ((Printer->GetSetup().Error != 0) ||
|
|
(strcmp(devName, Printer->GetSetup().GetDeviceName()) != 0) ||
|
|
(strcmp(driverName, Printer->GetSetup().GetDriverName()) != 0) ||
|
|
(strcmp(outputName, Printer->GetSetup().GetOutputName()) != 0)) {
|
|
|
|
// New printer installed so get the new printer device now.
|
|
delete Printer;
|
|
Printer = new TPrinter(this);
|
|
}
|
|
} else {
|
|
// No printer installed (GetProfileString failed).
|
|
delete Printer;
|
|
Printer = new TPrinter(this);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
##--END-- @OPT_APPL_PRINTING
|
|
int OwlMain (int , char* [])
|
|
{
|
|
try {
|
|
##--BEGIN-- @QUERY_APPL_OLE != VALUE_NOOLE
|
|
## :!@QUERY_APPL_OLE_AUTO 2
|
|
::Registrar = new TOcRegistrar(::ApplicationReg, TOleDocViewFactory<[[TApplication]]>(), TApplication::GetCmdLine(), ::DocTemplateStaticHead);
|
|
if (::Registrar->IsOptionSet(amAnyRegOption))
|
|
## :@QUERY_APPL_OLE_AUTO 2
|
|
::Registrar = new TOcRegistrar(::ApplicationReg, TOleDocViewAutoFactory<[[TApplication]]>(), TApplication::GetCmdLine(), ::DocTemplateStaticHead);
|
|
if (::Registrar->IsOptionSet(amAnyRegOption))
|
|
return 0;
|
|
|
|
// If this is an exe server normal run, run the app now. Otherwise, wait
|
|
// until our factory gets a call.
|
|
return ::Registrar->Run();
|
|
##--END-- @QUERY_APPL_OLE != VALUE_NOOLE
|
|
##--BEGIN-- @QUERY_APPL_OLE == VALUE_NOOLE
|
|
## :!@QUERY_APPL_OLE_AUTO 2
|
|
[[TApplication]] app;
|
|
return app.Run();
|
|
## --BEGIN-- @QUERY_APPL_OLE_AUTO
|
|
::Registrar = new TRegistrar(::ApplicationReg, TAutoFactory<[[TApplication]]>(), TApplication::GetCmdLine(), _hInstance);
|
|
if (::Registrar->IsOptionSet(amAnyRegOption))
|
|
return 0;
|
|
|
|
// If this is an exe server normal run, run the app now. Otherwise, wait
|
|
// until our factory gets a call.
|
|
return ::Registrar->Run();
|
|
## --END-- @QUERY_APPL_OLE_AUTO
|
|
##--END-- @QUERY_APPL_OLE == VALUE_NOOLE
|
|
}
|
|
catch (xmsg& x) {
|
|
::MessageBox(0, x.why().c_str(), "Exception", MB_OK);
|
|
}
|
|
|
|
return -1;
|
|
}
|