source410: literal 4.10 source reconstruction + BC++ 4.52 fleet toolchain archived
- 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>
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# ObjectWindows - (C) Copyright 1991, 1993 by Borland International
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
EXERES=printing
|
||||
MODELS=mldf
|
||||
!include $(BCEXAMPLEDIR)\owlmake.gen
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// ObjectWindows - (C) Copyright 1991, 1993 by Borland International
|
||||
// Printing program example using Application Framework Libraries (OWL)
|
||||
// This application displays and prints a Ruler using OWL printer classes.
|
||||
//----------------------------------------------------------------------------
|
||||
#include <owl\owlpch.h>
|
||||
#include <owl\applicat.h>
|
||||
#include <owl\framewin.h>
|
||||
#include <owl\dc.h>
|
||||
#include <owl\printer.h>
|
||||
#include <owl\editfile.rh>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// TWindowPrintout
|
||||
|
||||
class TWindowPrintout : public TPrintout {
|
||||
public:
|
||||
TWindowPrintout(const char* title, TWindow* window);
|
||||
|
||||
void GetDialogInfo(int& minPage, int& maxPage,
|
||||
int& selFromPage, int& selToPage);
|
||||
void PrintPage(int page, TRect& rect, unsigned flags);
|
||||
void SetBanding(BOOL b) {Banding = b;}
|
||||
BOOL HasPage(int pageNumber) {return pageNumber == 1;}
|
||||
|
||||
protected:
|
||||
TWindow* Window;
|
||||
BOOL Scale;
|
||||
};
|
||||
|
||||
TWindowPrintout::TWindowPrintout(const char* title, TWindow* window)
|
||||
: TPrintout(title)
|
||||
{
|
||||
Window = window;
|
||||
Scale = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
TWindowPrintout::PrintPage(int, TRect& rect, unsigned)
|
||||
{
|
||||
// Conditionally scale the DC to the window so the printout will
|
||||
// resemble the window
|
||||
//
|
||||
int prevMode;
|
||||
TSize oldVExt, oldWExt;
|
||||
if (Scale) {
|
||||
prevMode = DC->SetMapMode(MM_ISOTROPIC);
|
||||
TRect windowSize = Window->GetClientRect();
|
||||
DC->SetViewportExt(PageSize, &oldVExt);
|
||||
DC->SetWindowExt(windowSize.Size(), &oldWExt);
|
||||
DC->IntersectClipRect(windowSize);
|
||||
DC->DPtoLP(rect, 2);
|
||||
}
|
||||
|
||||
// Call the window to paint itself
|
||||
Window->Paint(*DC, FALSE, rect);
|
||||
|
||||
// Restore changes made to the DC
|
||||
if (Scale) {
|
||||
DC->SetWindowExt(oldWExt);
|
||||
DC->SetViewportExt(oldVExt);
|
||||
DC->SetMapMode(prevMode);
|
||||
}
|
||||
}
|
||||
|
||||
// Do not enable page range in the print dialog since only one page is
|
||||
// available to be printed
|
||||
//
|
||||
void
|
||||
TWindowPrintout::GetDialogInfo(int& minPage, int& maxPage,
|
||||
int& selFromPage, int& selToPage)
|
||||
{
|
||||
minPage = 0;
|
||||
maxPage = 0;
|
||||
selFromPage = selToPage = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// TRulerWin
|
||||
|
||||
class TRulerWin : public TFrameWindow {
|
||||
TPrinter* Printer;
|
||||
public:
|
||||
TRulerWin(TWindow* parent, const char* title, TModule* = 0);
|
||||
~TRulerWin();
|
||||
|
||||
void Paint(TDC&, BOOL, TRect&);
|
||||
|
||||
void CmFilePrint();
|
||||
void CmFilePrinterSetup();
|
||||
|
||||
DECLARE_RESPONSE_TABLE(TRulerWin);
|
||||
};
|
||||
|
||||
DEFINE_RESPONSE_TABLE1(TRulerWin, TFrameWindow)
|
||||
EV_COMMAND(CM_FILEPRINT, CmFilePrint),
|
||||
EV_COMMAND(CM_FILEPRINTERSETUP, CmFilePrinterSetup),
|
||||
END_RESPONSE_TABLE;
|
||||
|
||||
TRulerWin::TRulerWin(TWindow* parent, const char* title, TModule* module)
|
||||
: TFrameWindow(parent, title, 0, FALSE, module)
|
||||
{
|
||||
AssignMenu("RulerMenu");
|
||||
Attr.X = GetSystemMetrics(SM_CXSCREEN) / 8;
|
||||
Attr.Y = GetSystemMetrics(SM_CYSCREEN) / 8;
|
||||
Attr.H = Attr.Y * 6;
|
||||
Attr.W = Attr.X * 6;
|
||||
Printer = new TPrinter;
|
||||
}
|
||||
|
||||
TRulerWin::~TRulerWin()
|
||||
{
|
||||
delete Printer;
|
||||
}
|
||||
|
||||
void
|
||||
TRulerWin::CmFilePrint() // Execute File:Print command
|
||||
{
|
||||
if (Printer) {
|
||||
TWindowPrintout printout("Ruler Test", this);
|
||||
printout.SetBanding(TRUE);
|
||||
Printer->Print(this, printout, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TRulerWin::CmFilePrinterSetup() // Execute File:Printer-setup command
|
||||
{
|
||||
if (Printer)
|
||||
Printer->Setup(this);
|
||||
}
|
||||
|
||||
// Paint window's contents on any dc, screen or printer or whatever...
|
||||
//
|
||||
void
|
||||
TRulerWin::Paint(TDC& dc, BOOL, TRect&)
|
||||
{
|
||||
const UnitsPerInch = 100; // Display scale units per inch
|
||||
const NumInches = 8; // Size of ruler in inches
|
||||
const MarkFraction = 4; // Power of 2 to use for marks
|
||||
const MarksPerInch = (1<<MarkFraction); // Number of markers for each inch
|
||||
const LargeMarkerSize = UnitsPerInch/3; // Size of large, labeled markers
|
||||
const SmallMarkerSize = UnitsPerInch/8; // Size of smallest markers
|
||||
const MarkStep = (LargeMarkerSize-SmallMarkerSize) / MarkFraction;
|
||||
|
||||
dc.SaveDC();
|
||||
dc.SetMapMode(MM_LOENGLISH);
|
||||
int x1 = 0; //0.50 * UnitsPerInch;
|
||||
int y1 = x1;
|
||||
int x2 = x1 + NumInches * UnitsPerInch;
|
||||
int y2 = y1 + 1*UnitsPerInch;
|
||||
dc.Rectangle(x1, -y1, x2, -y2);
|
||||
|
||||
//
|
||||
// Draw marks
|
||||
//
|
||||
y2 = y1 + SmallMarkerSize;
|
||||
for (int marksPerInch = MarksPerInch; marksPerInch > 0; marksPerInch /= 2) {
|
||||
for (int i = 0; i <= NumInches*marksPerInch - 1; i++) {
|
||||
int x = x1 + (i * UnitsPerInch) / marksPerInch;
|
||||
dc.MoveTo(x, -y1);
|
||||
dc.LineTo(x, -y2);
|
||||
}
|
||||
y2 += MarkStep;
|
||||
}
|
||||
|
||||
//
|
||||
// Label the inch marks
|
||||
//
|
||||
y2 = y1 + LargeMarkerSize; // - text height
|
||||
for (int i = 1; i <= NumInches - 1; i++) {
|
||||
int x = x1 + i * UnitsPerInch; // - ( text width + 20%)
|
||||
char s[3];
|
||||
itoa(i, s, 10);
|
||||
dc.TextOut(TPoint(x, -y2), s, strlen(s));
|
||||
}
|
||||
|
||||
dc.RestoreDC();
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// TRulerApp
|
||||
|
||||
class TRulerApp : public TApplication {
|
||||
public:
|
||||
TRulerApp() : TApplication() {}
|
||||
void InitMainWindow() {
|
||||
EnableCtl3d();
|
||||
MainWindow = new TRulerWin(0, "Ruler Printing Demonstration");
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
OwlMain(int /*argc*/, char* /*argv*/ [])
|
||||
{
|
||||
return TRulerApp().Run();
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,76 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// ObjectWindows - (C) Copyright 1991, 1993 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef WORKSHOP_INVOKED
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <owl\editfile.rh>
|
||||
|
||||
#include <owl\owlapp.rc> // Owl icon
|
||||
|
||||
RulerMenu MENU
|
||||
{
|
||||
POPUP "&File"
|
||||
{
|
||||
MENUITEM "&Print...", CM_FILEPRINT
|
||||
MENUITEM "P&rinter Setup...", CM_FILEPRINTERSETUP
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit\tAlt+F4", CM_EXIT
|
||||
}
|
||||
}
|
||||
|
||||
#include <owl\printer.rh>
|
||||
#include <owl\printer.rc>
|
||||
#include <owl\except.rc>
|
||||
|
||||
ICON_1 ICON
|
||||
{
|
||||
'00 00 01 00 01 00 20 20 10 00 00 00 00 00 E8 02'
|
||||
'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
|
||||
'00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00'
|
||||
'00 00 80 00 80 00 80 80 00 00 80 80 80 00 C0 C0'
|
||||
'C0 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00'
|
||||
'00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 77'
|
||||
'77 77 77 77 77 77 77 77 77 77 77 77 77 70 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 70 00 BF'
|
||||
'BF BF BF BF BF BF BF BF BF BF BF BF B0 70 00 FB'
|
||||
'FB FB FB FB FB FB FB FB FB FB FB FB F0 70 00 BF'
|
||||
'BF BF B0 BF BF BF B0 BF BF BF B0 BF B0 70 00 FB'
|
||||
'F0 FB F0 FB F0 FB F0 FB F0 FB F0 FB F0 70 00 B0'
|
||||
'B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 70 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 77 77 77 77 77 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 07 70 00 00 00 00 00 00 00'
|
||||
'00 00 00 77 77 77 77 00 77 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00'
|
||||
'00 00 08 88 88 88 88 70 07 70 00 00 00 00 00 00'
|
||||
'00 00 08 88 88 99 98 77 00 70 00 00 00 00 00 00'
|
||||
'00 00 08 88 88 88 88 77 70 70 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 07 70 70 00 00 00 00 00 00'
|
||||
'00 00 00 0F FF FF 08 70 70 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 F0 70 F0 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 0F 07 0F 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 0F FF FF F0 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 C0 00'
|
||||
'00 01 80 00 00 01 80 00 00 01 80 00 00 01 80 00'
|
||||
'00 01 80 00 00 01 80 00 00 01 80 00 00 03 FF FF'
|
||||
'FF FF FF FF FF FF FF FC 7F FF FF FC 7F FF FF FC'
|
||||
'7F FF FF FC 7F FF FF F0 1F FF FF F8 3F FF FF FC'
|
||||
'7F FF FF FE FF FF FF C0 0F FF FF 80 07 FF FF 80'
|
||||
'03 FF FF 00 03 FF FF 00 01 FF FF 00 01 FF FF 00'
|
||||
'01 FF FF 80 01 FF FF C0 03 FF FF E0 07 FF FF E0'
|
||||
'1F FF FF F0 0F FF FF F0 0F FF FF FF FF FF'
|
||||
}
|
||||
Reference in New Issue
Block a user