From 5454ca44e614eb62597ec370f4108582ee8317cf Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:56:41 +0900 Subject: [PATCH 01/11] hotfix --- src/System/Utils/ConversionScript.ZC | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/System/Utils/ConversionScript.ZC b/src/System/Utils/ConversionScript.ZC index 8289fea9..c2c08474 100755 --- a/src/System/Utils/ConversionScript.ZC +++ b/src/System/Utils/ConversionScript.ZC @@ -74,7 +74,7 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S") Find("DrvTextAttrGet", ff_mask,fu_flags,"DriveTextAttrGet"); Find("DrvIsWritable", ff_mask,fu_flags,"DriveIsWritable"); Find("gr_palette_std", ff_mask,fu_flags,"gr32_palette_std"); - Find("GetKey",ff_mask, fu_flags,"KeyGet"); + Find("GetKey", ff_mask,fu_flags,"KeyGet"); Find("STD_DISTRO_DVD_CFG", ff_mask,fu_flags,"STD_DISTRO_DVD_CONFIG"); Find("CBGR48", ff_mask,fu_flags,"CBGR24"); Find("CFreeLst", ff_mask,fu_flags,"CFreeList"); @@ -92,6 +92,16 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S") Find("ScanChar",ff_mask,fu_flags,"CharScan"); Find("fp_final_scrn_update",ff_mask,fu_flags,"fp_final_screen_update"); + //Added by y4my4m April 25 2023 + Find("FifoI64Cnt", ff_mask,fu_flags,"FifoI64Count"); + Find("FifoI64Rem", ff_mask,fu_flags,"FifoI64Remove"); + Find("FifoU8Cnt", ff_mask,fu_flags,"FifoU8Count"); + Find("FifoU8Rem", ff_mask,fu_flags,"FifoU8Remove"); + Find("AdamErr", ff_mask,fu_flags,"SysErr"); + Find("AdamLog", ff_mask,fu_flags,"SysLog"); + Find("CHashGlblVar", ff_mask,fu_flags,"CHashGlobalVar"); + Find("HTT_GLBL_VAR", ff_mask,fu_flags,"HTT_GLOBAL_VAR"); + "\n$$BK,1$$$$LTRED$$Might want to go over these$$FG$$$$BK,0$$\n"; Find("MemSet", ff_mask, fu_flags); } From 7dd0d0e327d8081ea9a52ec011857c01e58315f6 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Wed, 26 Apr 2023 01:57:21 +0900 Subject: [PATCH 02/11] fp_draw --- src/System/Utils/ConversionScript.ZC | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/System/Utils/ConversionScript.ZC b/src/System/Utils/ConversionScript.ZC index c2c08474..1fc9fa35 100755 --- a/src/System/Utils/ConversionScript.ZC +++ b/src/System/Utils/ConversionScript.ZC @@ -101,6 +101,9 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S") Find("AdamLog", ff_mask,fu_flags,"SysLog"); Find("CHashGlblVar", ff_mask,fu_flags,"CHashGlobalVar"); Find("HTT_GLBL_VAR", ff_mask,fu_flags,"HTT_GLOBAL_VAR"); + Find("fp_draw_ms", ff_mask,fu_flags,"fp_draw_mouse"); + Find("fp_draw_grab_ms", ff_mask,fu_flags,"fp_draw_grab_mouse"); + Find("fp_final_scrn_update",ff_mask,fu_flags,"fp_final_screen_update"); "\n$$BK,1$$$$LTRED$$Might want to go over these$$FG$$$$BK,0$$\n"; Find("MemSet", ff_mask, fu_flags); From 2f56a6649656f9b6087f678ff16adf97c1150b94 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Wed, 26 Apr 2023 02:13:02 +0900 Subject: [PATCH 03/11] sys --- src/System/Utils/ConversionScript.ZC | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/System/Utils/ConversionScript.ZC b/src/System/Utils/ConversionScript.ZC index 1fc9fa35..6d1eb03e 100755 --- a/src/System/Utils/ConversionScript.ZC +++ b/src/System/Utils/ConversionScript.ZC @@ -104,6 +104,8 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S") Find("fp_draw_ms", ff_mask,fu_flags,"fp_draw_mouse"); Find("fp_draw_grab_ms", ff_mask,fu_flags,"fp_draw_grab_mouse"); Find("fp_final_scrn_update",ff_mask,fu_flags,"fp_final_screen_update"); + Find("DCColorChg", ff_mask,fu_flags,"DCColorChange"); + Find("Adam(", ff_mask,fu_flags,"Sys("); // using Adam( not to rename lists that contain the name Adam "\n$$BK,1$$$$LTRED$$Might want to go over these$$FG$$$$BK,0$$\n"; Find("MemSet", ff_mask, fu_flags); From 16efdf32145b3ef8514ce3018a0177a9410bdc92 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Wed, 26 Apr 2023 02:24:52 +0900 Subject: [PATCH 04/11] KbdMsHndlr --- src/System/Utils/ConversionScript.ZC | 1 + 1 file changed, 1 insertion(+) diff --git a/src/System/Utils/ConversionScript.ZC b/src/System/Utils/ConversionScript.ZC index 6d1eb03e..f6360dbb 100755 --- a/src/System/Utils/ConversionScript.ZC +++ b/src/System/Utils/ConversionScript.ZC @@ -106,6 +106,7 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S") Find("fp_final_scrn_update",ff_mask,fu_flags,"fp_final_screen_update"); Find("DCColorChg", ff_mask,fu_flags,"DCColorChange"); Find("Adam(", ff_mask,fu_flags,"Sys("); // using Adam( not to rename lists that contain the name Adam + Find("KbdMsHndlr", ff_mask,fu_flags,"KbdMouseHandler"); "\n$$BK,1$$$$LTRED$$Might want to go over these$$FG$$$$BK,0$$\n"; Find("MemSet", ff_mask, fu_flags); From 1840f7f78257adbb9708ef81234e6ca625b18a29 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Wed, 26 Apr 2023 02:32:40 +0900 Subject: [PATCH 05/11] fix --- src/System/Utils/ConversionScript.ZC | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/System/Utils/ConversionScript.ZC b/src/System/Utils/ConversionScript.ZC index f6360dbb..efb434e1 100755 --- a/src/System/Utils/ConversionScript.ZC +++ b/src/System/Utils/ConversionScript.ZC @@ -107,6 +107,9 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S") Find("DCColorChg", ff_mask,fu_flags,"DCColorChange"); Find("Adam(", ff_mask,fu_flags,"Sys("); // using Adam( not to rename lists that contain the name Adam Find("KbdMsHndlr", ff_mask,fu_flags,"KbdMouseHandler"); + Find("WinMsUpdate", ff_mask,fu_flags,"WinMouseUpdate"); + Find("RWF_SHOW_DOLLAR", ff_mask,fu_flags,"RAWF_SHOW_DOLLAR"); + Find("RWF_SCROLL", ff_mask,fu_flags,"RAWF_SCROLL"); "\n$$BK,1$$$$LTRED$$Might want to go over these$$FG$$$$BK,0$$\n"; Find("MemSet", ff_mask, fu_flags); From 22e03fbbb67c4cc0084a096a6aad321fbe44b936 Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Wed, 26 Apr 2023 02:42:45 +0900 Subject: [PATCH 06/11] fix --- src/System/Utils/ConversionScript.ZC | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/System/Utils/ConversionScript.ZC b/src/System/Utils/ConversionScript.ZC index efb434e1..91373bf9 100755 --- a/src/System/Utils/ConversionScript.ZC +++ b/src/System/Utils/ConversionScript.ZC @@ -109,7 +109,10 @@ U0 Cvt(U8 *ff_mask="*", U8 *fu_flags="+r+l-i+S") Find("KbdMsHndlr", ff_mask,fu_flags,"KbdMouseHandler"); Find("WinMsUpdate", ff_mask,fu_flags,"WinMouseUpdate"); Find("RWF_SHOW_DOLLAR", ff_mask,fu_flags,"RAWF_SHOW_DOLLAR"); + Find("RWF_LAST_DOLLAR", ff_mask,fu_flags,"RAWF_LAST_DOLLAR"); + Find("RWF_IN_DOLLAR", ff_mask,fu_flags,"RAWF_IN_DOLLAR"); Find("RWF_SCROLL", ff_mask,fu_flags,"RAWF_SCROLL"); + Find("RawDr", ff_mask,fu_flags,"RawDumpRegs"); "\n$$BK,1$$$$LTRED$$Might want to go over these$$FG$$$$BK,0$$\n"; Find("MemSet", ff_mask, fu_flags); From bd5b85389ec938450ad863e32137fd67dbc3c13f Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Sun, 7 May 2023 23:58:47 -0400 Subject: [PATCH 07/11] Create CPU + RAM visualization demo. --- src/Demo/Graphics/Usage.ZC | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 src/Demo/Graphics/Usage.ZC diff --git a/src/Demo/Graphics/Usage.ZC b/src/Demo/Graphics/Usage.ZC new file mode 100755 index 00000000..729d7b2a --- /dev/null +++ b/src/Demo/Graphics/Usage.ZC @@ -0,0 +1,59 @@ + +U0 UsageDrawIt(CTask *, CDC *dc) +{ + I64 i, b; + CCPU *c; + F64 f; + + dc->thick = 1; + + dc->color = GREEN; + GrPrint(dc, 8, 8, "CPU"); + + dc->color = DKGRAY; + GrRect(dc, 8, 16, 100, 8 + 16 * (mp_count - 1)); + + dc->color = GREEN; + for (i = 0; i < mp_count; i++) + { + c = &cpu_structs[i]; + + f = 100.0 * (1.0 - c->idle_factor); + if (f < 1.0) + f = 1.0; + + GrRect(dc, 8, 16 + (16*i), ToI64(f), 8); + } + + b = sys_code_bp->alloced_u8s - sys_code_bp->used_u8s; + if (sys_data_bp) + b += sys_data_bp->alloced_u8s - sys_data_bp->used_u8s; + + f = 1.0 * b / MemBIOSTotal; + + + dc->color = RED; + GrPrint(dc, 116, 8, "RAM"); + + dc->color = DKGRAY; + GrRect(dc, 116, 16, 100, 8); + dc->color = RED; + GrRect(dc, 116, 16, ToI64(100.0 * (1.0 - f)), 8); + + Sleep(1); +} + +U0 Usage() +{ + SettingsPush; + DocClear; + DocCursor; + Fs->draw_it = &UsageDrawIt; + StrCopy(Fs->task_title, "Usage"); + + while (CharGet(,FALSE) != CH_SHIFT_ESC) {}; + + SettingsPop; +}; + +Usage; \ No newline at end of file From 561f056c71f8d13a1001d75d3970fc0c2e415492 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Wed, 17 May 2023 01:44:50 -0400 Subject: [PATCH 08/11] Remove 0x5 cursor byte from files --- src/Demo/Graphics/Usage.ZC | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Demo/Graphics/Usage.ZC b/src/Demo/Graphics/Usage.ZC index 729d7b2a..668b6f07 100755 --- a/src/Demo/Graphics/Usage.ZC +++ b/src/Demo/Graphics/Usage.ZC @@ -56,4 +56,4 @@ U0 Usage() SettingsPop; }; -Usage; \ No newline at end of file +Usage; \ No newline at end of file From 6288c403e61fa635c8153caa1efc99350d4b7d60 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Wed, 17 May 2023 01:47:37 -0400 Subject: [PATCH 09/11] Increase PCNet RX/TX buf count to 64. --- src/Home/Net/Drivers/PCNet.ZC | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Home/Net/Drivers/PCNet.ZC b/src/Home/Net/Drivers/PCNet.ZC index 26b09f1d..f338ef43 100755 --- a/src/Home/Net/Drivers/PCNet.ZC +++ b/src/Home/Net/Drivers/PCNet.ZC @@ -73,8 +73,8 @@ #define PCNET_CTRL_IDON 8 #define PCNET_CTRL_RINT 10 -#define PCNET_RX_BUFF_COUNT 32 // Linux & Shrine Driver use 32 and 8 for -#define PCNET_TX_BUFF_COUNT 8 // these, we could allow more if wanted. +#define PCNET_RX_BUFF_COUNT 64 +#define PCNET_TX_BUFF_COUNT 64 #define PCNET_DESCRIPTORf_ENP 24 #define PCNET_DESCRIPTORf_STP 25 @@ -417,8 +417,9 @@ U8 *PCNetInitBlockSetup() U32 p_setup; u_setup->mode = 0; - u_setup->rlen = 5 << 4; - u_setup->tlen = 3 << 4; + u_setup->rlen = ToI64(Log2(PCNET_RX_BUFF_COUNT)) << 4; + u_setup->tlen = ToI64(Log2(PCNET_TX_BUFF_COUNT)) << 4; + MemCopy(u_setup->mac, pcnet.mac_address, 6); u_setup->reserved = 0; MemSet(u_setup->ladr, 0, 8); From 3311b483e891b9fc84eca374fb91cd84c7357074 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Wed, 17 May 2023 01:56:45 -0400 Subject: [PATCH 10/11] Remove unused NetLogTask method. --- src/Home/Net/Utilities/NetLog.ZC | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/Home/Net/Utilities/NetLog.ZC b/src/Home/Net/Utilities/NetLog.ZC index dfc0d3d4..caecce87 100755 --- a/src/Home/Net/Utilities/NetLog.ZC +++ b/src/Home/Net/Utilities/NetLog.ZC @@ -1,14 +1,5 @@ CTask *net_log_task = NULL; -U0 NetLogTask(I64) -{ - - while (TRUE) - { - Refresh; - } -} - U0 NetLogSave() { StrCopy(net_log_task->put_doc->filename.name, "::/Home/Net/Log.DD"); From a551afdd909946ac2c2e4e4be7692dbd1b823808 Mon Sep 17 00:00:00 2001 From: GutPuncher Date: Wed, 17 May 2023 01:57:31 -0400 Subject: [PATCH 11/11] Optimize and debug NetLog DocBottom implementation. --- src/Home/Net/Utilities/NetLog.ZC | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Home/Net/Utilities/NetLog.ZC b/src/Home/Net/Utilities/NetLog.ZC index caecce87..845f4dac 100755 --- a/src/Home/Net/Utilities/NetLog.ZC +++ b/src/Home/Net/Utilities/NetLog.ZC @@ -22,14 +22,29 @@ U0 NetLogInit() DocPrint(net_log_task->put_doc, "$$WW+H,1$$"); +// net_log_task->put_doc->max_entries = I64_MAX; + Bts(&net_log_task->win_inhibit, WIf_SELF_FOCUS); } +U0 NetLogBottom() +{//Move cursor, cur_entry, to bottom. + Bool unlock; + CDoc *doc = net_log_task->put_doc; + + unlock = DocLock(doc); + doc->cur_entry = doc; + doc->cur_col = 0; + if (unlock) + DocUnlock(doc); +} + U0 NetLog(U8 *format, ...) { // Output text to NetLogTask as Log. U8 *buf = StrPrintJoin(NULL, format, argc, argv); - DocBottom(net_log_task->put_doc); + NetLogBottom; + DocPrint(net_log_task->put_doc, "%s\n", buf); Free(buf); @@ -39,7 +54,8 @@ U0 NetWarn(U8 *format, ...) { // Output text to NetLogTask as Warning. U8 *buf = StrPrintJoin(NULL, format, argc, argv); - DocBottom(net_log_task->put_doc); + NetLogBottom; + DocPrint(net_log_task->put_doc, "$$BG,BROWN$$$$WHITE$$%s$$BG$$$$FG$$\n", buf); Free(buf); @@ -49,7 +65,8 @@ U0 NetErr(U8 *format, ...) { // Output text to NetLogTask as Error. U8 *buf = StrPrintJoin(NULL, format, argc, argv); - DocBottom(net_log_task->put_doc); + NetLogBottom; + DocPrint(net_log_task->put_doc, "$$BG,RED$$$$WHITE$$%s$$BG$$$$FG$$\n", buf); Free(buf); @@ -59,7 +76,8 @@ U0 NetDebug(U8 *format, ...) { // Output text to NetLogTask as Debug. U8 *buf = StrPrintJoin(NULL, format, argc, argv); - DocBottom(net_log_task->put_doc); + NetLogBottom; + DocPrint(net_log_task->put_doc, "$$BG,YELLOW$$$$DKGRAY$$%s$$BG$$$$FG$$\n", buf); Free(buf);