Fix K.CC and DoDistro, automatically find ATA drive SATA port.

Fix illegal forward reference compiler error in DiskAddDev.CC.
Change 32BitDemo.CC to use a #define for the square draw delay.
Fixed Span game bottom mass location and cost report.
Fix CastleFrankenstein slowdown on bare-metal when turning.
Fix TreeCheckers move radius.
Implement palette swapping for some games.
This commit is contained in:
TomAwezome 2021-06-26 20:36:19 -04:00
parent 1cbc72e57b
commit 7989d5fcaa
44 changed files with 48 additions and 31 deletions

Binary file not shown.

View file

@ -13,7 +13,7 @@
#define FIXED_X3 (TEXT_COLS * FONT_WIDTH >> 1)
#define FIXED_Y1 ((SKY_LINES + 1) * FONT_HEIGHT)
#define FIXED_Y2 ((SKY_LINES + 5) * FONT_HEIGHT)
#define FIXED_Y3 ((TEXT_ROWS - 8) * FONT_HEIGHT)
#define FIXED_Y3 ((SKY_LINES + 12) * FONT_HEIGHT)
#define LOAD_WEIGHTS 8

View file

@ -72,7 +72,7 @@ U0 DrawIt(CTask *task, CDC *dc)
}
dc->color = BLACK;
GrPrint(dc, 90, 0, "Cost:%12.2, f", Cost(ode));
GrPrint(dc, 90, 0, "Cost:%12.2,f", Cost(ode));
GrPrint(dc, 90, FONT_HEIGHT, "Time:%12.2f", SpanTime);
}

View file

@ -716,6 +716,7 @@ U0 Strut()
PressAKey;
bt_main_mode = CtrlBttnNew((GR_WIDTH - 4 * FONT_WIDTH - 16) >> 1, 1 * FONT_HEIGHT + 4, 80,, MMD_MODES_NUM,
Define("ST_MAIN_MODES"), main_mode_colors, &main_mode_bttn);
PaletteSetLight(FALSE);
DocClear;
Init;
Fs->draw_it = &DrawIt;

View file

@ -1555,6 +1555,7 @@ U0 XCaliber()
WinMax;
DocCursor;
DocClear;
PaletteSetLight(FALSE);
Fs->win_inhibit = WIG_TASK_DEFAULT - WIF_SELF_FOCUS - WIF_SELF_BORDER - WIF_FOCUS_TASK_MENU - WIF_SELF_CTRLS;
Fs->draw_it = &DrawIt;
do

View file

@ -564,7 +564,8 @@ U0 MoveMan(F64
while (step);
}
#define MICRO_STEPS 4
//#define MICRO_STEPS 4
#define MICRO_STEPS 24
U0 RotateMan(F64 d)
{
I64 i;
@ -572,7 +573,8 @@ U0 RotateMan(F64 d)
for (i = 0; i < MICRO_STEPS; i++)
{
man_é += d / MICRO_STEPS;
Sleep(15);
// Sleep(15);
Sleep(1);
}
}
@ -628,11 +630,13 @@ U0 CastleFrankenstein()
switch (sc.u8[0])
{
case SC_CURSOR_RIGHT:
Spawn(&RotateMan, (ã / 32)(I64));
// Spawn(&RotateMan, (ã / 32)(I64));
RotateMan(ã / 32);
break;
case SC_CURSOR_LEFT:
Spawn(&RotateMan, (-ã / 32)(I64));
// Spawn(&RotateMan, (-ã / 32)(I64));
RotateMan(-ã / 32);
break;
case SC_CURSOR_UP:

View file

@ -1071,6 +1071,8 @@ U0 Chess()
brd_dc = BrdNew;
SetMouseCursor;
PaletteSetLight(FALSE);
Fs->draw_it = &DrawIt;
try

View file

@ -6,7 +6,7 @@ U0 InitDefines()
throw;
DefinePrint("UNITS_NUM", "%d", 4096 / SqrI64(rad) & ~1);
DefinePrint("CIRCLE_RAD", "%d", rad);
DefinePrint("MOVE_CIRCLES", "%d", 40 / rad);
DefinePrint("MOVE_CIRCLES", "%d", 65 / rad);
cols = (w - 8 - rad) / (2 * rad) & ~1 - 1;
DefinePrint("BORDER_X", "%d", (w + rad - cols * 2 * rad) / 2);

View file

@ -1,5 +1,6 @@
#define SQUARE_SIZE 20
#define SQUARE_GAP 5
#define SQUARE_SIZE 20
#define SQUARE_GAP 5
#define SQUARE_DELAY 5 // mS
I0 DrawPixel(I64 x, I64 y, CBGR24 color)
{
@ -27,7 +28,7 @@ I0 Color32Demo()
for (j = 0; j < SQUARE_SIZE; j++)
DrawPixel(x + i, y + j, color);
Sleep(100);
Sleep(SQUARE_DELAY);
}
text.is_fb_busy = FALSE;

0
src/Home/CosmicGLDemos/DrawBSP/DOOM1.WAD Normal file → Executable file
View file

0
src/Home/CosmicGLDemos/DrawBSP/DrawBSP.CC Normal file → Executable file
View file

View file

@ -44,7 +44,7 @@ calls singing moist days excellence.", gr_palette[GREEN]);
while (CharScan() == 0)
{
Tex2DDebugDisp(&frameBuf, wX, wY);
Tex2DDebugDisp(&frameBuf, wX, wY);
Sleep(1);
}

0
src/Home/CosmicGLDemos/ModelLoading/KingTerry.wad Normal file → Executable file
View file

0
src/Home/CosmicGLDemos/ModelLoading/TerryTruth.CC Normal file → Executable file
View file

0
src/Home/CosmicGLDemos/ModelLoading/TerryTruth.ZM Normal file → Executable file
View file

View file

0
src/Home/CosmicGLDemos/TextureLoading/SaintTerry.bmp Normal file → Executable file
View file

Before

(image error) Size: 192 KiB

After

(image error) Size: 192 KiB

0
src/Home/CosmicGLDemos/TexturedTriangle/MrGod.bmp Normal file → Executable file
View file

Before

(image error) Size: 192 KiB

After

(image error) Size: 192 KiB

View file

View file

@ -1,17 +1,19 @@
//Make Your own Distro by #include-ing this file.
//#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT \n\n1024\n768\n\n\n"
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n5\n\n\n"
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n1024\n768\n\n\n"
U0 MakeMyISO(U8 *_out_iso_filename)
{//Does everything with current drive.
//If you have not recompiled $FG,2$Kernel$FG$ and defined your CD/DVD drive, use $LK,"Mount",A="MN:Mount"$.
U8 *out_iso_filename = FileNameAbs(_out_iso_filename);
if (!DriveIsWritable)
{
"Drive must be writable. Install on Hard drive, first.\n";
return;
}
DelTree("/Distro");
Del(out_iso_filename);

View file

@ -1,6 +1,26 @@
//Ed("/Doc/ChangeLog.DD");
In("CC\n0\n\n5\n\n\n");
CAHCIPort *port;
I64 i, ata_drive = -1;
// Find first-available ATA drive for BootHDIns.
for (i = 0; i < AHCI_MAX_PORTS; i++)
{
if (Bt(&blkdev.ahci_hba->ports_implemented, i))
{
port = &blkdev.ahci_hba->ports[i];
if (port->signature == AHCI_PxSIG_ATA)
{
ata_drive = i;
break;
}
}
}
if (ata_drive < 0)
throw('No ATA');
In("CC\n%d\n\n1024\n768\n\n\n", ata_drive);
BootHDIns;
"\n\nSuccessful? ";

View file

@ -1,10 +0,0 @@
$TR,"Zenith"$
$ID,2$$TR,"SysMessageFlags"$
$ID,2$sys_message_flags[0]=0;
$ID,-2$$TR,"SysRegVer"$
$ID,2$registry_version=2.010;
$ID,-2$$ID,-2$$TR,"Once"$
$ID,2$$TR,"Zenith"$
$ID,2$$ID,-2$$TR,"User"$
$ID,2$$ID,-2$$ID,-2$$TR,"AutoComplete"$
$ID,2$ac.col=98;ac.row=23;$ID,-2$

View file

@ -279,13 +279,7 @@ U0 BlkDevsInitAll()
"If running in a VM, ensure disks are organized under a SATA controller.\n\n"
"Rebooting in 10 seconds...\n";
Sleep(10*1000);
// Reboot; // illegal forward ref compiler error?
*0x472(U16 *) = 0; // Manual reboot
OutU8(0x70, 0x8F);
OutU8(0x71, 0x00);
OutU8(0x70, 0x00);
OutU8(0x92, InU8(0x92) | 1);
SysHlt;
Reboot;
}
#exe {

View file

@ -112,6 +112,8 @@ extern U0 Print(U8 *format, ...);
extern U0 PutChars(U64 ch);
extern U0 PutS(U8 *st); //Use $LK,"Print",A="MN:Print"$()
extern U0 Reboot(Bool format_ramdisks=FALSE);
extern I64 RedSeaAllocClus(CDrive *drive, I64 count);
extern Bool RedSeaDirNew(CDrive *drive, U8 *cur_dir, CDirEntry *tmpde, Bool free_old_chain);
extern Bool RedSeaFileFind(CDrive *drive, I64 cur_dir_clus, U8 *name, CDirEntry *_res, I64 fuf_flags=0);

0
src/Zenith/CosmicGL/Docs/CosmicGLOverview.DD Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Draw/Primitive.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Draw/Rectangle.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Draw/Text.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Draw/Texture.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Draw/UIIrix.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Draw/UISmooth.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/MakeCosmicGL.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Math/Math.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Math/Types.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Math/Vec2.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Math/Vec3.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Render/Rasterize.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Render/Shader.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Texture/Texture.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/Texture/TextureImport.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/WAD/DoomMap.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/WAD/DoomTypes.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/WAD/WAD.CC Normal file → Executable file
View file

0
src/Zenith/CosmicGL/WAD/WADTypes.CC Normal file → Executable file
View file