Merge branch 'master' into telnet

This commit is contained in:
チャールズ 2023-05-17 15:04:33 +09:00 committed by GitHub
commit 97dfec41b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 109 additions and 18 deletions

59
src/Demo/Graphics/Usage.ZC Executable file
View file

@ -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;

View file

@ -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);

View file

@ -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");
@ -31,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);
@ -48,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);
@ -58,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);
@ -68,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);

View file

@ -92,6 +92,28 @@ 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");
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
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);
}