upstream branch of example of personal Zeal customization and scripting

This commit is contained in:
GutPuncher 2024-04-03 01:13:41 -04:00
parent cd46dc4ab3
commit 5f04b9fe50
No known key found for this signature in database
GPG key ID: 38CE0A7B6841D1C7
16 changed files with 394 additions and 4 deletions

3
src/Home/.ZC Executable file
View file

@ -0,0 +1,3 @@
In("CC\n1\n\n\n\n\n");
BootHDIns('c');
//Reboot;

60
src/Home/AFF.ZC Executable file
View file

@ -0,0 +1,60 @@
U0 zz()
{
U16 *screen, *last_screen = gr.screen_cache;
U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2;
/*
if (gr.screen_zoom == 1)
screen = gr.dc2->body;
else
screen = gr.zoomed_dc->body;
*/
for (i = 0; i < diffs_size; i++)
{
if (screen[i] != last_screen[i])
dst[i] = src[i];
}
// MemCopy(gr.screen_cache, screen, diffs_size * 2);
}
U0 zzz()
{
U16 *screen, *last_screen = gr.screen_cache;
U64 i, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 2;
/*
if (gr.screen_zoom == 1)
screen = gr.dc2->body;
else
screen = gr.zoomed_dc->body;
*/
for (i = 0; i < diffs_size; i++)
{
if (*(screen + i) != *(last_screen + i))
*(dst + i) = *(src + i);
}
// MemCopy(gr.screen_cache, screen, diffs_size * 2);
}
"\n\n\n";
Uf("zz");
"\n\n\n";
Uf("zzz");"\n\n\n";
/*
The only way to make this faster,
is to force usage of XMM into this ? ?
*/

1
src/Home/F.ZC Executable file
View file

@ -0,0 +1 @@
Spawn(&CtrlAltF);;

72
src/Home/GRZ.ZC Executable file
View file

@ -0,0 +1,72 @@
U0 GrZoomInScreen1()
{
I64 i, j, k, l;
U8 *src, *src2, *dst;
GrFixZoomScale;
src = gr.dc2->body + gr.sx + gr.sy * gr.dc2->width_internal;
dst = gr.zoomed_dc->body;
for (i = 0; i < GR_HEIGHT / gr.screen_zoom; i++)
{
k = gr.screen_zoom;
while (k--)
{
src2 = src;
for (l = 0; l < GR_WIDTH / gr.screen_zoom; l++)
{
for (j = 0; j < gr.screen_zoom - 1; j++)
*dst++ = *src2;
*dst++ = *src2++;
}
}
src += GR_WIDTH;
}
}
U0 GrZoomInScreen2()
{
I64 i, j, k, l,
bobus = GR_HEIGHT / gr.screen_zoom,
beebus = GR_WIDTH / gr.screen_zoom,
sprinkle = gr.screen_zoom - 1;
U8 *src, *src2, *dst;
GrFixZoomScale;
src = gr.dc2->body + gr.sx + gr.sy * gr.dc2->width_internal;
dst = gr.zoomed_dc->body;
for (i = 0; i < bobus; i++)
{
k = gr.screen_zoom;
while (k--)
{
src2 = src;
for (l = 0; l < beebus; l++)
{
for (j = 0; j < sprinkle; j++)
*dst++ = *src2;
*dst++ = *src2++;
}
}
src += GR_WIDTH;
}
}
Uf "GrZoomInScreen1";
"\n\n";
Uf "GrZoomInScreen2";
"\n";

22
src/Home/MakeHome.ZC Executable file
View file

@ -0,0 +1,22 @@
Cd(__DIR__);;
//If these are not present in /Home, it uses the version in the root dir. You
//can make your own, modified, version of these files in your /Home directory.
#include "~/HomeLocalize"
#include "/System/Boot/MakeBoot"
#include "/System/Utils/MakeUtils"
#include "~/HomeWrappers"
MapFileLoad("::/Kernel/Kernel");
MapFileLoad("::/Compiler/Compiler");
#include "~/HomeKeyPlugIns"
#include "~/HomeSys"
Cd("..");;
Sys("#include \"C:/Home/PaletteEditor/Palettes/Amicus.ZC\";;;PaletteSetAmicus;;");
//Sys("SwapI64(&text.font, &text.aux_font);;");
Sys("U0 Z(){Spawn(&MouseHardDriverInstall);};;;");
Sys("U0 MouseFix(){ Spawn(&MouseHardDriverInstall);; } ;; ");
Sys("#include \"C:/Home/PaletteEditor/Palettes/Vapor.ZC\";;;PaletteSetVapor;;;" );
Sys("PaletteSetAmicus;;;");
Sys("mouse_hard.scale.x = mouse_hard.scale.y = mouse_hard.scale.z = 2.0;;;;");

10
src/Home/NestedEq.ZC Executable file
View file

@ -0,0 +1,10 @@
U64 x = 3;
"\nx: %d\n", x;
U64 y = (x <<= 2) * 2;
"\ny: %d\n", y;
"\nx: %d\n", x;

View file

@ -41,7 +41,7 @@ I64 FTPReplyPassiveParse(CTCPSocket *message_socket, CSocketAddressIPV4 *dest_ad
recv_sum += recv;
}
str = StrNew(buf);
cc = CompCtrlNew(str);
cc = CompCtrlNew(str, CCF_NO_CHAR_CONST);
while ((tk = Lex(cc)))
{
@ -91,6 +91,8 @@ parse_done:
}
CompCtrlDel(cc);
if (res < 0) // error on parse
"\n[FTPReplyPassiveParse]: buf='%s'\n", buf;
return res;
}

11
src/Home/Z.ZC Executable file
View file

@ -0,0 +1,11 @@
/*
F("sys_os_v");
"\n\n\n";
F("DD_OS_");
*/
I64 line_count = LineRep("/*", "-r") + LineRep("/System/*") + LineRep("/Compiler/*", "-S+$$") + LineRep("/Kernel/*");
DocTreeFWrite("/System/Define.ZC", "LineRep", "DefinePrint(\"DD_ZEALOS_LOC\",\"%,d\");\n", line_count);
DefinePrint("DD_ZEALOS_LOC", "%,d", line_count);
"Total LOC:%12,d\n\n", line_count;

112
src/Home/skip.ZC Executable file
View file

@ -0,0 +1,112 @@
/*
U8 skip = 0;
while (TRUE)
{
"skip %d\n", skip;
"skip and 3... %d\n", skip & 3;
"skip and 7... %d\n", skip & 7;
"skip and 15... %d\n", skip & 15;
if (skip > 4 * 15)
skip = 0;
skip++;
}
*/
U0 GrCalcScreenUpdates1()
{
U64 *screen, *last_screen = gr.screen_cache, i, ii, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 8;
U8 skip = gr.screen_cache[0]; // use 1st U8 of cache as flag to skip cache MemCopy every-other call.
U8 skip_inactives = 2, skip_chunks = 7;
if (gr.screen_zoom == 1)
screen = gr.dc2->body;
else
screen = gr.zoomed_dc->body;
for (i = 0; i < diffs_size; i++)
if (screen[i] != last_screen[i])
{
ii = i * 4;
dst[ii] = src[ii++];
dst[ii] = src[ii++];
dst[ii] = src[ii++];
dst[ii] = src[ii];
}
if (skip < skip_chunks * skip_inactives)
{
if (skip % skip_inactives == 0)
{
MemCopy(dst + ((skip/skip_inactives)*text.buffer_size / skip_chunks / 8),
src + ((skip/skip_inactives)*text.buffer_size / skip_chunks / 8),
text.buffer_size / skip_chunks);
MemCopy(gr.screen_cache + ((skip/skip_inactives)*diffs_size * 8 / skip_chunks), screen + ((skip/skip_inactives)*diffs_size * 8 / skip_chunks / 8), diffs_size * 8 / skip_chunks);
}
}
else
skip = -1;
gr.screen_cache[0] = ++skip;
}
U0 GrCalcScreenUpdates2()
{
U64 *screen, *last_screen = gr.screen_cache, i, ii, *src = text.raw_screen, *dst = text.fb_alias, diffs_size = GR_WIDTH * GR_HEIGHT / 8,
skip = gr.screen_cache[0], // use 1st U8 of cache as flag to skip cache MemCopy every-other call.
skip_inactives = 2, skip_chunks = 7, skip_size64 = skip / skip_inactives * text.buffer_size / skip_chunks / 8, skip_diff = diffs_size * 8 / skip_chunks, skip_size8 = skip / skip_inactives * skip_diff;
if (gr.screen_zoom == 1)
screen = gr.dc2->body;
else
screen = gr.zoomed_dc->body;
for (i = 0; i < diffs_size; i++)
if (screen[i] != last_screen[i])
{
ii = i * 4;
dst[ii] = src[ii++];
dst[ii] = src[ii++];
dst[ii] = src[ii++];
dst[ii] = src[ii];
}
if (skip < skip_chunks * skip_inactives)
{
if (skip % skip_inactives == 0)
{
MemCopy(dst + skip_size64,
src + skip_size64,
text.buffer_size / skip_chunks);
MemCopy(gr.screen_cache + skip_size8, screen(U8 *) + skip_size8, skip_diff);
}
}
else
skip = -1;
gr.screen_cache[0] = ++skip;
}
Uf "GrCalcScreenUpdates1";
"\n\n";
Uf "GrCalcScreenUpdates2";
"\n";

4
src/Home/z_UfGrCalc.ZC Executable file
View file

@ -0,0 +1,4 @@
Uf "GrCalcScreenUpdates";
In("\n\nMan(\"GrCalcScreenUpdates\");");

45
src/Home/zz.ZC Executable file
View file

@ -0,0 +1,45 @@
//In("B\n2*1024*1024\n\n");Mount;
// See BlkDevRep
I64 i, dst_blks;
CBlkDev *b = blkdev.blkdevs;
U8 *dst_disk, dst_let, got = FALSE;
for (i = 0; i < BLKDEVS_NUM; i++)
{ // look for a RAM Disk
if (b[i].bd_signature == BD_SIGNATURE_VAL)
{
if (b[i].RAM_disk)
{
dst_disk = b[i].RAM_disk;
dst_let = b[i].first_drive_let;
dst_blks = b[i].max_blk;
"\tRAM disk address:\t0x%X\n", dst_disk;
"\tDrive Letter:\t%C\n", dst_let;
"\tDrive Max Block:\t0x%X\n", dst_blks;
got = TRUE;
break;
}
}
}
if (!got)
Break;
U8 *dst_str = MStrPrint("%C:/", dst_let);
U8 *dst_disk_str = MStrPrint("0x%0X", dst_disk);
U8 *dst_blks_str = MStrPrint("%d", dst_blks);
//CopyTree("::/", dst_str);
Drive(dst_let);
In("BB");
In(dst_disk_str);
In("\n");
In(dst_blks_str);
In("\n\n\n\n");
MakeAll;
Cd("Kernel");
Sleep(3333);
BootRAM("Kernel.ZXE");

44
src/Home/zzz.ZC Executable file
View file

@ -0,0 +1,44 @@
In("B\n2*1024*1024\n\n");Mount;
// See BlkDevRep
I64 i, dst_blks;
CBlkDev *b = blkdev.blkdevs;
U8 *dst_disk, dst_let, got = FALSE;
for (i = 0; i < BLKDEVS_NUM; i++)
{ // look for a RAM Disk
if (b[i].bd_signature == BD_SIGNATURE_VAL)
{
if (b[i].RAM_disk)
{
dst_disk = b[i].RAM_disk;
dst_let = b[i].first_drive_let;
dst_blks = b[i].max_blk;
"\tRAM disk address:\t0x%X\n", dst_disk;
"\tDrive Letter:\t%C\n", dst_let;
"\tDrive Max Block:\t0x%X\n", dst_blks;
got = TRUE;
break;
}
}
}
if (!got)
Break;
U8 *dst_str = MStrPrint("%C:/", dst_let);
U8 *dst_disk_str = MStrPrint("0x%0X", dst_disk);
U8 *dst_blks_str = MStrPrint("%d", dst_blks);
//"%s %s %s \n\n", dst_str, dst_disk_str, dst_blks_str;
CopyTree("::/", dst_str);
Drive(dst_let);
In("BB");
In(dst_disk_str);
In("\n");
In(dst_blks_str);
In("\n\n\n\n");
MakeAll;
Cd("Kernel");
Sleep(3333);
BootRAM("Kernel.ZXE");

View file

@ -79,7 +79,7 @@ See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$().
if (ch_bitmap & 1)
*framebuffer++ = WHITE32;
else
*framebuffer++ = BLACK32;
*framebuffer++ = RED32;
if (i & (FONT_WIDTH - 1) == FONT_WIDTH - 1)
framebuffer += sys_framebuffer_width - FONT_WIDTH;
ch_bitmap >>= 1;

View file

@ -70,8 +70,8 @@ SYS_FRAMEBUFFER_LIST:: DU8 sizeof(CVideoInfo) * VBE_MODES_NUM DUP(0);
#assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE)
REQUESTED_SCREEN_WIDTH: DU16 1024;
REQUESTED_SCREEN_HEIGHT: DU16 768;
REQUESTED_SCREEN_WIDTH: DU16 1920;
REQUESTED_SCREEN_HEIGHT: DU16 1080;
VBE_TEMP_MODE: DU8 sizeof(CVBEMode) DUP(0);
VBE_INFO: DU8 sizeof(CVBEInfo) DUP(0);

View file

@ -498,6 +498,7 @@ class CPatchTableAbsAddr
#define BLACK32 0x000000
#define WHITE32 0xFFFFFF
#define RED32 0xFF0000
#define VBE_MODES_NUM 32
class CVBEInfo

View file

@ -119,3 +119,6 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S")
}
//Cvt("Sup1/*");
//TODO add flushmessages
// TODO D( --> Dump(