mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-06-07 08:14:48 +00:00
ms -> mouse, fmt -> format, cfg -> config
This commit is contained in:
parent
abd611374d
commit
38e3210ec0
Binary file not shown.
@ -501,8 +501,8 @@ U0 AnimateTask(CTask *parent_task)
|
||||
Shoot(o);
|
||||
if (!o->shooting) {
|
||||
if (o==human) {
|
||||
dx=(ms.pos.x-parent_task->pix_left-parent_task->scroll_x)-o->x;
|
||||
dy=(ms.pos.y-parent_task->pix_top-parent_task->scroll_y)*2-o->y;
|
||||
dx=(mouse.pos.x-parent_task->pix_left-parent_task->scroll_x)-o->x;
|
||||
dy=(mouse.pos.y-parent_task->pix_top-parent_task->scroll_y)*2-o->y;
|
||||
} else {
|
||||
if (!someone_has_ball && o->nearest_man_dd>4*MAN_SQR_RADIUS &&
|
||||
o->nearest_ball) {
|
||||
|
@ -313,7 +313,7 @@ U0 DrawPickTools()
|
||||
psm.dc2->color=RED;
|
||||
else
|
||||
psm.dc2->color=BLACK;
|
||||
(*gr.fp_draw_ms)(psm.dc2,PSM_TOOLS_X+15,PSM_TOOLS_Y);
|
||||
(*gr.fp_draw_mouse)(psm.dc2,PSM_TOOLS_X+15,PSM_TOOLS_Y);
|
||||
psm.dc2->color=BLACK;
|
||||
}
|
||||
|
||||
|
@ -430,7 +430,7 @@ U0 Psalmody(U8 *dirname="~/Psalmody")
|
||||
while (TRUE) {
|
||||
was_playing=FALSE;
|
||||
mo_start:
|
||||
if (ms.pos_text.y-Fs->win_top<18)
|
||||
if (mouse.pos_text.y-Fs->win_top<18)
|
||||
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP|
|
||||
1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_L_UP|1<<MESSAGE_MS_R_UP|
|
||||
1<<MESSAGE_MS_MOVE|1<<MESSAGE_CMD);
|
||||
@ -642,7 +642,7 @@ mo_got_message:
|
||||
while (tmpn!=&psm.head) {
|
||||
if (tmpn->type!=PSMT_METER) {
|
||||
timeout_val=counts.jiffies;
|
||||
if (ms.pos_text.y-Fs->win_top<18)
|
||||
if (mouse.pos_text.y-Fs->win_top<18)
|
||||
message_code=ScanMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|
|
||||
1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_R_UP|1<<MESSAGE_CMD);
|
||||
else
|
||||
@ -652,7 +652,7 @@ mo_got_message:
|
||||
Sound;
|
||||
psm.playing=FALSE;
|
||||
was_playing=TRUE;
|
||||
if (ms.pos_text.y-Fs->win_top>=18 &&
|
||||
if (mouse.pos_text.y-Fs->win_top>=18 &&
|
||||
message_code==MESSAGE_MS_L_DOWN)
|
||||
goto mo_start;
|
||||
else
|
||||
|
@ -36,8 +36,8 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
|
||||
}
|
||||
|
||||
if (cursor_mass) {
|
||||
p2.x=ms.pos.x-task->pix_left-task->scroll_x;
|
||||
p2.y=ms.pos.y-task->pix_top-task->scroll_y;
|
||||
p2.x=mouse.pos.x-task->pix_left-task->scroll_x;
|
||||
p2.y=mouse.pos.y-task->pix_top-task->scroll_y;
|
||||
p2.z=0;
|
||||
D3Sub(&p,&p2,&cursor_mass->state->x);
|
||||
d=10.0*D3NormSqr(&p);
|
||||
|
@ -43,8 +43,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
if (cursor_mass) {
|
||||
dc->color=RED;
|
||||
dc->thick=2;
|
||||
GrLine3(dc,ms.pos.x-task->pix_left-task->scroll_x,
|
||||
ms.pos.y-task->pix_top-task->scroll_y,0,
|
||||
GrLine3(dc,mouse.pos.x-task->pix_left-task->scroll_x,
|
||||
mouse.pos.y-task->pix_top-task->scroll_y,0,
|
||||
cursor_mass->x,cursor_mass->y,0);
|
||||
}
|
||||
|
||||
|
@ -64,14 +64,14 @@ U0 W2S(F64 wx,F64 wy,F64 *_sx,F64 *_sy)
|
||||
U0 Zoom(F64 d)
|
||||
{
|
||||
F64 sx,sy,wx,wy;
|
||||
I64 i,x=ms.pos.x,y=ms.pos.y;
|
||||
I64 i,x=mouse.pos.x,y=mouse.pos.y;
|
||||
d=Exp(Ln(d)/ZOOM_STEPS);
|
||||
for (i=0;i<ZOOM_STEPS;i++) {
|
||||
S2W(x,y,&wx,&wy);
|
||||
zoom=Clamp(zoom*d,0.02,50);
|
||||
W2S(wx,wy,&sx,&sy);
|
||||
task->scroll_x=ms.pos.x-sx-task->pix_left;
|
||||
task->scroll_y=ms.pos.y-sy-task->pix_top;
|
||||
task->scroll_x=mouse.pos.x-sx-task->pix_left;
|
||||
task->scroll_y=mouse.pos.y-sy-task->pix_top;
|
||||
Sleep(10);
|
||||
}
|
||||
}
|
||||
@ -460,7 +460,7 @@ U0 EditShip()
|
||||
case MESSAGE_MS_L_DOWN:
|
||||
switch (edit_mode_bttn.state) {
|
||||
case EMD_MASS:
|
||||
S2W(ms.pos.x,ms.pos.y,&wx,&wy);
|
||||
S2W(mouse.pos.x,mouse.pos.y,&wx,&wy);
|
||||
tmpm1=PlaceMass(wx,wy);
|
||||
if (ode->next_mass==tmpm1)
|
||||
tmpm1->img=$IB,"<1>",BI=1$;
|
||||
@ -472,7 +472,7 @@ U0 EditShip()
|
||||
case EMD_CONNECTOR:
|
||||
case EMD_THRUSTER:
|
||||
case EMD_MOVE:
|
||||
S2W(ms.pos.x,ms.pos.y,&wx,&wy);
|
||||
S2W(mouse.pos.x,mouse.pos.y,&wx,&wy);
|
||||
tmpm1=MassFind(ode,wx,wy);
|
||||
tmpm2=NULL;
|
||||
break;
|
||||
@ -485,13 +485,13 @@ U0 EditShip()
|
||||
case EMD_SPRING:
|
||||
case EMD_CONNECTOR:
|
||||
case EMD_THRUSTER:
|
||||
S2W(ms.pos.x,ms.pos.y,&wx,&wy);
|
||||
S2W(mouse.pos.x,mouse.pos.y,&wx,&wy);
|
||||
if (tmpm1 && (tmpm2=MassFind(ode,wx,wy)) && tmpm1!=tmpm2)
|
||||
PlaceSpring(tmpm1,tmpm2,edit_mode_bttn.state);
|
||||
tmpm1=tmpm2=NULL;
|
||||
break;
|
||||
case EMD_MOVE:
|
||||
S2W(ms.pos.x,ms.pos.y,&wx,&wy);
|
||||
S2W(mouse.pos.x,mouse.pos.y,&wx,&wy);
|
||||
if (tmpm1) {
|
||||
tmpm1->x=wx;
|
||||
tmpm1->y=wy;
|
||||
@ -505,7 +505,7 @@ U0 EditShip()
|
||||
case MESSAGE_MS_MOVE:
|
||||
switch (edit_mode_bttn.state) {
|
||||
case EMD_MOVE:
|
||||
S2W(ms.pos.x,ms.pos.y,&wx,&wy);
|
||||
S2W(mouse.pos.x,mouse.pos.y,&wx,&wy);
|
||||
if (tmpm1) {
|
||||
tmpm1->x=wx;
|
||||
tmpm1->y=wy;
|
||||
|
Binary file not shown.
@ -3,7 +3,7 @@ import U0 DocBinsValidate(CDoc *doc);
|
||||
import U0 DocDel(CDoc *doc);
|
||||
import U0 DocLoad(CDoc *doc,U8 *src2,I64 size);
|
||||
import CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL);
|
||||
import CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...);
|
||||
import CDocEntry *DocPrint(CDoc *doc=NULL,U8 *format,...);
|
||||
import CDocEntry *DocPutLine(CDoc *doc,CDocEntry *doc_e);
|
||||
import I64 DocSize(CDoc *doc);
|
||||
import Bool DocWrite(CDoc *doc,Bool prompt=FALSE);
|
||||
|
@ -602,10 +602,10 @@ I64 ExePutS(U8 *buf,U8 *filename=NULL,
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 ExePrint(U8 *fmt,...)
|
||||
I64 ExePrint(U8 *format,...)
|
||||
{//JIT Compile and execute text from a printf().
|
||||
I64 res;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
res=ExePutS(buf);
|
||||
Free(buf);
|
||||
return res;
|
||||
@ -645,10 +645,10 @@ I64 ExePutS2(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0)
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 ExePrint2(U8 *fmt,...)
|
||||
I64 ExePrint2(U8 *format,...)
|
||||
{//throws exceptions
|
||||
I64 res;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
res=ExePutS2(buf);
|
||||
Free(buf);
|
||||
return res;
|
||||
@ -670,9 +670,9 @@ I64 RunFile2(U8 *name,I64 ccf_flags=0,...)
|
||||
return LastFun(argc,argv);
|
||||
}
|
||||
|
||||
I64 StreamExePrint(U8 *fmt,...)
|
||||
I64 StreamExePrint(U8 *format,...)
|
||||
{//Causes value from stream to be used in an #exe{} block.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
I64 res=0;
|
||||
CLexHashTableContext *htc;
|
||||
CCompCtrl *cc=Fs->last_cc;
|
||||
|
@ -65,9 +65,9 @@ Bool Echo(Bool val)
|
||||
return Option(OPTf_ECHO,val);
|
||||
}
|
||||
|
||||
U0 StreamPrint(U8 *fmt,...)
|
||||
U0 StreamPrint(U8 *format,...)
|
||||
{//Injects text into the compile stream. Used in #exe{} blocks.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st;
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv),*st;
|
||||
CCompCtrl *cc=Fs->last_cc;
|
||||
CStreamBlk *tmpe=cc->last_stream_blk;
|
||||
if (tmpe!=&cc->next_stream_blk) {
|
||||
|
Binary file not shown.
@ -2,8 +2,8 @@
|
||||
extern U0 CInit(Bool first);
|
||||
public extern I64 ExeFile(U8 *name,I64 ccf_flags=0);
|
||||
public extern I64 ExeFile2(U8 *name,I64 ccf_flags=0);
|
||||
public extern I64 ExePrint(U8 *fmt,...);
|
||||
public extern I64 ExePrint2(U8 *fmt,...);
|
||||
public extern I64 ExePrint(U8 *format,...);
|
||||
public extern I64 ExePrint2(U8 *format,...);
|
||||
public extern I64 ExePutS(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0,
|
||||
CLexHashTableContext *htc=NULL);
|
||||
public extern I64 ExePutS2(U8 *buf,U8 *filename=NULL,I64 ccf_flags=0);
|
||||
@ -18,8 +18,8 @@ public extern Bool Echo(Bool val);
|
||||
public extern Bool GetOption(I64 num);
|
||||
public extern I64 PassTrace(I64 i=0b1001111101);
|
||||
extern U0 StreamDir();
|
||||
public extern I64 StreamExePrint(U8 *fmt,...);
|
||||
public extern U0 StreamPrint(U8 *fmt,...);
|
||||
public extern I64 StreamExePrint(U8 *format,...);
|
||||
public extern U0 StreamPrint(U8 *format,...);
|
||||
public extern Bool Trace(Bool val=ON);
|
||||
|
||||
#help_index "Compiler/Lex"
|
||||
|
@ -402,7 +402,7 @@ I64 ParseFunCall(CCompCtrl *cc,CPrsStack *ps,Bool indirect,CHashFun *tmpf)
|
||||
} else {
|
||||
if (!(tmpf=HashFind("Print",cc->htc.hash_table_list,HTT_FUN)))
|
||||
LexExcept(cc,"Missing header for Print() and PutChars() at ");
|
||||
if (!*cc->cur_str) //empty string signals Print with variable fmt_str
|
||||
if (!*cc->cur_str) //empty string signals Print with variable format_str
|
||||
Lex(cc);
|
||||
is_putchars=FALSE;
|
||||
is_print=TRUE;
|
||||
|
@ -11,11 +11,11 @@ local_time_offset=-7*60*60*CDATE_FREQ; //Pacific
|
||||
// Remember you can set the time in the BIOS.
|
||||
|
||||
//$AN,"",A="mouse_move_scale"$adjust these to set mouse move scale
|
||||
ms_hard.scale.x=0.5;
|
||||
ms_hard.scale.y=0.5;
|
||||
ms_hard.scale.z=5.0; //wheel
|
||||
mouse_hard.scale.x=0.5;
|
||||
mouse_hard.scale.y=0.5;
|
||||
mouse_hard.scale.z=5.0; //wheel
|
||||
|
||||
//don't change these
|
||||
ms_hard.prescale.x=ms_hard.pos.x/ms_hard.scale.x;
|
||||
ms_hard.prescale.y=ms_hard.pos.y/ms_hard.scale.y;
|
||||
ms_hard.prescale.z=ms_hard.pos.z/ms_hard.scale.z;
|
||||
mouse_hard.prescale.x=mouse_hard.pos.x/mouse_hard.scale.x;
|
||||
mouse_hard.prescale.y=mouse_hard.pos.y/mouse_hard.scale.y;
|
||||
mouse_hard.prescale.z=mouse_hard.pos.z/mouse_hard.scale.z;
|
||||
|
@ -166,7 +166,7 @@ $FG,5$$TX+CX,"TODO: Too Hard, or Not Worth Doing."$$FG$
|
||||
* Compiler: FunPtr local vars? I forgot if this was hard or not.
|
||||
$ID,5$$HL,1$U0 Main()
|
||||
{
|
||||
U0 (*fp_old_draw_ms)(CDC *dc,I64 x,I64 y)=gr.fp_draw_ms;
|
||||
U0 (*fp_old_draw_mouse)(CDC *dc,I64 x,I64 y)=gr.fp_draw_mouse;
|
||||
}
|
||||
$ID,-5$$HL,0$
|
||||
* Compiler: Get rid of $LK,"0x20000",A="FF:::/Compiler/CMain.HC,0x20000"$ limit.
|
||||
@ -205,7 +205,7 @@ $FG,5$$TX+CX,"Bugs? Not really sure."$$FG$
|
||||
|
||||
* 1/?/2015,8/10/2015 Macro sel in Menu did not go to shell? No, I think just <CTRL-m> twice. Not a bug.
|
||||
|
||||
* 5/7/14:Something like $LK,"InSetMs",A="MN:InSetMs"$ caused hang, then reboot in TestSuite.
|
||||
* 5/7/14:Something like $LK,"InSetMouse",A="MN:InSetMouse"$ caused hang, then reboot in TestSuite.
|
||||
* 5/7/14:#63 Maybe, $LK,"::/Demo/Graphics/Pick3D.HC"$ crashed in TestSuite.
|
||||
|
||||
* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(,st); With st="\n\\"; (Forgot what this is talking about.)
|
||||
@ -283,7 +283,7 @@ $FG,5$$TX+CX,"Committee Needed"$$FG$
|
||||
* Eliminate? $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$() change to 3x3?
|
||||
* Eliminate? $LK,"ROP_XOR",A="MN:ROP_XOR"$?
|
||||
|
||||
* $LK,"WinMgrTask",A="MN:WinMgrTask"$ needs to do doc operations on $LK,"PostMessage",A="MN:PostMessage"$() messages for ms_hard. Already works for $LK,"MsSet",A="MN:MsSet"$()?
|
||||
* $LK,"WinMgrTask",A="MN:WinMgrTask"$ needs to do doc operations on $LK,"PostMessage",A="MN:PostMessage"$() messages for mouse_hard. Already works for $LK,"MouseSet",A="MN:MouseSet"$()?
|
||||
|
||||
* Should Messages in PopUp queue get fwded to parent when task dies?
|
||||
|
||||
@ -389,7 +389,7 @@ $FG,5$$TX+CX,"Test"$$FG$
|
||||
|
||||
* $LK,"FileMgr",A="MN:FileMgr"$() help link scrolls out of window.
|
||||
|
||||
* $LK,"MsHardDriverInstall",A="MN:MsHardDriverInstall"$() throws exceptions? Doesn't work? Why mouse $LK,"0x9FC30",A="FF:::/Kernel/SerialDev/Mouse.HC,9FC"$?
|
||||
* $LK,"MouseHardDriverInstall",A="MN:MouseHardDriverInstall"$() throws exceptions? Doesn't work? Why mouse $LK,"0x9FC30",A="FF:::/Kernel/SerialDev/Mouse.HC,9FC"$?
|
||||
|
||||
* VirtualBox MP reboot?
|
||||
|
||||
@ -418,7 +418,7 @@ catches divide and out-of-mem. Not sure what to do, yet.
|
||||
* Might make CSprite flood fill operate on a separate bitmap
|
||||
and blotted at the end.
|
||||
* <CTRL-r> delete subsprite in menu near others
|
||||
* make better heapwalk, do something with $LK,"_CFG_HEAP_DBG",A="FF:::/Kernel/KernelA.HH,_CFG_HEAP_DBG"$.
|
||||
* make better heapwalk, do something with $LK,"_CONFIG_HEAP_DBG",A="FF:::/Kernel/KernelA.HH,_CONFIG_HEAP_DBG"$.
|
||||
|
||||
* static var off of data heap.
|
||||
* could add "const" to not set CCF_NOT_CONST flag for trig, etc.
|
||||
|
@ -1,7 +1,7 @@
|
||||
Cd(__DIR__);;
|
||||
|
||||
#include "TOSExt"
|
||||
#include "TOSCfg"
|
||||
#include "TOSConfig"
|
||||
#include "TOSMisc"
|
||||
#include "TOSDistro"
|
||||
|
||||
|
@ -1,61 +0,0 @@
|
||||
#help_index "Misc/TOS/Cfg"
|
||||
|
||||
#define SLOP BLK_SIZE
|
||||
|
||||
U0 TOSDebugDistro1()
|
||||
{
|
||||
CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
DefinePrint("TOS_DBG_DISTRO","0x%X",
|
||||
CeilI64(SYS_KERNEL_END+SLOP,BLK_SIZE));
|
||||
DefinePrint("TOS_DBG_DISTRO_END", "0x%X",FloorI64(
|
||||
(BOOT_RAM_LIMIT-(BOOT_STACK_SIZE+DVD_BOOT_LOADER_SIZE))>>4<<4-
|
||||
(bfh(I64)-SYS_KERNEL_END)-SLOP,BLK_SIZE));
|
||||
DefinePrint("CFG_DBG_DISTRO_FILE","\"/Tmp/DebugDistro.BIN\"");
|
||||
} TOSDebugDistro1;
|
||||
|
||||
U0 TOSDebugDistro2()
|
||||
{
|
||||
DefinePrint("CFG_DBG_DISTRO","\"a0x%X\n0x%X\n\"",TOS_DBG_DISTRO,
|
||||
(TOS_DBG_DISTRO_END-TOS_DBG_DISTRO)/BLK_SIZE);
|
||||
DefinePrint("CFG_DBG_DISTRO_START","\"0x%X\"",TOS_DBG_DISTRO);
|
||||
} TOSDebugDistro2;
|
||||
|
||||
U0 TOSInit()
|
||||
{
|
||||
switch (INS_REG_MACHINE_NUM) {
|
||||
case 1: //TAD Native Machine
|
||||
DefinePrint("CFG_RAM_DRIVES",
|
||||
"\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\"");
|
||||
DefinePrint("CFG_HARD_DRIVES","\"C\ns0xFE00\n0xFE10\n0\"");
|
||||
DefinePrint("CFG_DVD_DRIVES","\"Ts0x1F0\n1\"");
|
||||
DefinePrint("CFG_DISK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\"");
|
||||
DefinePrint("TOS_HDS","\"CD\"");
|
||||
DefinePrint("TOS_MASTER_BOOT_DRIVES","\"C\"");
|
||||
break;
|
||||
default:
|
||||
DefinePrint("CFG_RAM_DRIVES",
|
||||
"\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\"");
|
||||
DefinePrint("CFG_HARD_DRIVES","\"\"");
|
||||
DefinePrint("CFG_DVD_DRIVES","\"\"");
|
||||
DefinePrint("CFG_DISK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\"");
|
||||
DefinePrint("TOS_HDS","\"CD\"");
|
||||
DefinePrint("TOS_MASTER_BOOT_DRIVES","\"C\"");
|
||||
}
|
||||
} TOSInit;
|
||||
|
||||
#define TOS_ISO_NAME "B:/TOS_Distro.ISO.C"
|
||||
#define TOS_DISTRO_DIR "B:/Distro"
|
||||
#define CFG_OPTS "StaffMode\nMountIDEAuto\nCT\n"
|
||||
#define CFG_DBG_OPTS "StaffMode\nMountIDEAuto\nCT"\
|
||||
"HeapInit\n130\nMemInit\n131\nVarInit\n132\n\n"
|
||||
#define CFG_DBGZ_OPTS "StaffMode\nMountIDEAuto\nCT"\
|
||||
"HeapInit\n0\nMemInit\n0\nVarInit\n0\n\n"
|
||||
#define TOS_CFG "\n" CFG_RAM_DRIVES CFG_DVD_DRIVES CFG_HARD_DRIVES "\n"\
|
||||
CFG_DISK_CACHE CFG_OPTS
|
||||
#define TOS_DVD_CFG "TB\n0x20000\nT\n\n\nStaffMode\nMountIDEAuto\nCT\n"
|
||||
#define TOS_DVD_DBG_CFG "A" CFG_DBG_DISTRO\
|
||||
"B\nScale2Mem(2048,0x40000)\n\n\n"\
|
||||
"NoMP\nTextMode\nDontProbe\nDebugDistro\n"\
|
||||
"C:" CFG_DBG_DISTRO_FILE "\n"\
|
||||
CFG_DBG_DISTRO_START "\n\n"
|
61
src/Demo/AcctExample/TOS/TOSConfig.HC
Executable file
61
src/Demo/AcctExample/TOS/TOSConfig.HC
Executable file
@ -0,0 +1,61 @@
|
||||
#help_index "Misc/TOS/Config"
|
||||
|
||||
#define SLOP BLK_SIZE
|
||||
|
||||
U0 TOSDebugDistro1()
|
||||
{
|
||||
CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
DefinePrint("TOS_DBG_DISTRO","0x%X",
|
||||
CeilI64(SYS_KERNEL_END+SLOP,BLK_SIZE));
|
||||
DefinePrint("TOS_DBG_DISTRO_END", "0x%X",FloorI64(
|
||||
(BOOT_RAM_LIMIT-(BOOT_STACK_SIZE+DVD_BOOT_LOADER_SIZE))>>4<<4-
|
||||
(bfh(I64)-SYS_KERNEL_END)-SLOP,BLK_SIZE));
|
||||
DefinePrint("CONFIG_DBG_DISTRO_FILE","\"/Tmp/DebugDistro.BIN\"");
|
||||
} TOSDebugDistro1;
|
||||
|
||||
U0 TOSDebugDistro2()
|
||||
{
|
||||
DefinePrint("CONFIG_DBG_DISTRO","\"a0x%X\n0x%X\n\"",TOS_DBG_DISTRO,
|
||||
(TOS_DBG_DISTRO_END-TOS_DBG_DISTRO)/BLK_SIZE);
|
||||
DefinePrint("CONFIG_DBG_DISTRO_START","\"0x%X\"",TOS_DBG_DISTRO);
|
||||
} TOSDebugDistro2;
|
||||
|
||||
U0 TOSInit()
|
||||
{
|
||||
switch (INS_REG_MACHINE_NUM) {
|
||||
case 1: //TAD Native Machine
|
||||
DefinePrint("CONFIG_RAM_DRIVES",
|
||||
"\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\"");
|
||||
DefinePrint("CONFIG_HARD_DRIVES","\"C\ns0xFE00\n0xFE10\n0\"");
|
||||
DefinePrint("CONFIG_DVD_DRIVES","\"Ts0x1F0\n1\"");
|
||||
DefinePrint("CONFIG_DISK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\"");
|
||||
DefinePrint("TOS_HDS","\"CD\"");
|
||||
DefinePrint("TOS_MASTER_BOOT_DRIVES","\"C\"");
|
||||
break;
|
||||
default:
|
||||
DefinePrint("CONFIG_RAM_DRIVES",
|
||||
"\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\"");
|
||||
DefinePrint("CONFIG_HARD_DRIVES","\"\"");
|
||||
DefinePrint("CONFIG_DVD_DRIVES","\"\"");
|
||||
DefinePrint("CONFIG_DISK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\"");
|
||||
DefinePrint("TOS_HDS","\"CD\"");
|
||||
DefinePrint("TOS_MASTER_BOOT_DRIVES","\"C\"");
|
||||
}
|
||||
} TOSInit;
|
||||
|
||||
#define TOS_ISO_NAME "B:/TOS_Distro.ISO.C"
|
||||
#define TOS_DISTRO_DIR "B:/Distro"
|
||||
#define CONFIG_OPTS "StaffMode\nMountIDEAuto\nCT\n"
|
||||
#define CONFIG_DBG_OPTS "StaffMode\nMountIDEAuto\nCT"\
|
||||
"HeapInit\n130\nMemInit\n131\nVarInit\n132\n\n"
|
||||
#define CONFIG_DBGZ_OPTS "StaffMode\nMountIDEAuto\nCT"\
|
||||
"HeapInit\n0\nMemInit\n0\nVarInit\n0\n\n"
|
||||
#define TOS_CONFIG "\n" CONFIG_RAM_DRIVES CONFIG_DVD_DRIVES CONFIG_HARD_DRIVES "\n"\
|
||||
CONFIG_DISK_CACHE CONFIG_OPTS
|
||||
#define TOS_DVD_CONFIG "TB\n0x20000\nT\n\n\nStaffMode\nMountIDEAuto\nCT\n"
|
||||
#define TOS_DVD_DBG_CONFIG "A" CONFIG_DBG_DISTRO\
|
||||
"B\nScale2Mem(2048,0x40000)\n\n\n"\
|
||||
"NoMP\nTextMode\nDontProbe\nDebugDistro\n"\
|
||||
"C:" CONFIG_DBG_DISTRO_FILE "\n"\
|
||||
CONFIG_DBG_DISTRO_START "\n\n"
|
@ -1,4 +1,4 @@
|
||||
//The CFG defines are $LK,"~/TOS/TOSCfg.HC",A="FI:::/Demo/AcctExample/TOS/TOSCfg.HC"$.
|
||||
//The CONFIG defines are $LK,"~/TOS/TOSConfig.HC",A="FI:::/Demo/AcctExample/TOS/TOSConfig.HC"$.
|
||||
|
||||
#help_index "Misc/TOS/Distro"
|
||||
|
||||
@ -18,22 +18,22 @@ public U8 TOSGetDrive()
|
||||
public U0 TOSBootHDIns(U8 drv_let=0)
|
||||
{//Make Compiler and Kernel. Reinstall Kernel.
|
||||
drv_let=Letter2Letter(drv_let);
|
||||
In(TOS_CFG);
|
||||
In(TOS_CONFIG);
|
||||
BootHDIns(drv_let);
|
||||
if (StrOcc(TOS_MASTER_BOOT_DRIVES,drv_let))
|
||||
BootMHDIns(drv_let);
|
||||
}
|
||||
|
||||
public U0 TOSCopyDrive(U8 src,U8 dst)
|
||||
{//Fmt dst and copy entire drv.
|
||||
{//Format dst and copy entire drv.
|
||||
U8 buf_s[STR_LEN],buf_d[STR_LEN];
|
||||
src=Letter2Letter(src);
|
||||
dst=Letter2Letter(dst);
|
||||
|
||||
if (dst=='D')
|
||||
Fmt(dst,,FALSE,FSt_FAT32);
|
||||
Format(dst,,FALSE,FSt_FAT32);
|
||||
else
|
||||
Fmt(dst,,FALSE,FSt_REDSEA);
|
||||
Format(dst,,FALSE,FSt_REDSEA);
|
||||
|
||||
StrPrint(buf_s,"%c:/",src);
|
||||
StrPrint(buf_d,"%c:/",dst);
|
||||
@ -45,7 +45,7 @@ public U0 TOSCopyDrive(U8 src,U8 dst)
|
||||
}
|
||||
|
||||
public U0 TOSPromptAndCopyDrive()
|
||||
{//Prompt for drv lets. Then, Fmt dst and copy entire drv.
|
||||
{//Prompt for drv lets. Then, Format dst and copy entire drv.
|
||||
I64 src,dst;
|
||||
"$$RED$$\nCopy Src Drive:\n$$FG$$";
|
||||
src=TOSGetDrive;
|
||||
@ -90,11 +90,11 @@ U0 DebugDistroFilePrep()
|
||||
{
|
||||
CBlkDev *bd;
|
||||
if (!Letter2Drive('A',FALSE)) {
|
||||
In(CFG_DBG_DISTRO "\n");
|
||||
In(CONFIG_DBG_DISTRO "\n");
|
||||
Mount;
|
||||
}
|
||||
bd=Letter2BlkDev('A');
|
||||
Fmt('A',,FALSE,FSt_REDSEA);
|
||||
Format('A',,FALSE,FSt_REDSEA);
|
||||
|
||||
DirMk("A:/Compiler");
|
||||
Copy("C:/Compiler/Compiler.BIN", "A:/Compiler");
|
||||
@ -117,7 +117,7 @@ U0 DebugDistroFilePrep()
|
||||
Copy("C:/Zenith/AMem.HC", "A:/Zenith");
|
||||
Copy("C:/Zenith/TaskRep.HC", "A:/Zenith");
|
||||
|
||||
FileWrite("C:" CFG_DBG_DISTRO_FILE,
|
||||
FileWrite("C:" CONFIG_DBG_DISTRO_FILE,
|
||||
bd->RAM_disk,(bd->max_blk+1)<<BLK_SIZE_BITS);
|
||||
}
|
||||
|
||||
@ -126,9 +126,9 @@ U0 StdDistroPrep()
|
||||
{
|
||||
Drive('C');
|
||||
DistroPrep;
|
||||
In(STD_DISTRO_DVD_CFG);
|
||||
In(STD_DISTRO_DVD_CONFIG);
|
||||
BootDVDIns('C');
|
||||
Fmt('B',,FALSE,FSt_REDSEA);
|
||||
Format('B',,FALSE,FSt_REDSEA);
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
DelTree(TOS_DISTRO_DIR "/Home");
|
||||
@ -151,9 +151,9 @@ U0 LiteDistroPrep()
|
||||
{
|
||||
Drive('C');
|
||||
DistroPrep;
|
||||
In(STD_DISTRO_DVD_CFG);
|
||||
In(STD_DISTRO_DVD_CONFIG);
|
||||
BootDVDIns('C');
|
||||
Fmt('B',,FALSE,FSt_REDSEA);
|
||||
Format('B',,FALSE,FSt_REDSEA);
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
DelTree(TOS_DISTRO_DIR "/Home");
|
||||
@ -183,9 +183,9 @@ U0 DebugDistroPrep()
|
||||
Drive('C');
|
||||
DistroPrep;
|
||||
DebugDistroFilePrep;
|
||||
In(TOS_DVD_DBG_CFG);
|
||||
In(TOS_DVD_DBG_CONFIG);
|
||||
BootDVDIns('C');
|
||||
Fmt('B',,FALSE,FSt_REDSEA);
|
||||
Format('B',,FALSE,FSt_REDSEA);
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
DelTree(TOS_DISTRO_DIR "/Home");
|
||||
@ -208,9 +208,9 @@ U0 StaffDistroPrep()
|
||||
{
|
||||
Drive('C');
|
||||
DistroPrep;
|
||||
In(TOS_DVD_CFG);
|
||||
In(TOS_DVD_CONFIG);
|
||||
BootDVDIns('C');
|
||||
Fmt('B',,FALSE,FSt_REDSEA);
|
||||
Format('B',,FALSE,FSt_REDSEA);
|
||||
DelTree(TOS_DISTRO_DIR);
|
||||
CopyTree("C:/",TOS_DISTRO_DIR "/");
|
||||
DelTree(TOS_DISTRO_DIR "/Home/Sup1");
|
||||
@ -383,5 +383,5 @@ public U0 TOSRegen()
|
||||
{//Generate distro ISO's
|
||||
TOSBootHDIns('C');
|
||||
Once("TOSRegen2;");
|
||||
BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot to load $LK,"TOS_CFG",A="PF:::/Demo/AcctExample/TOS/TOSCfg.HC,TOS_CFG"$.
|
||||
BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot to load $LK,"TOS_CONFIG",A="PF:::/Demo/AcctExample/TOS/TOSConfig.HC,TOS_CONFIG"$.
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
See $LK,"Data Tag Width",A="FA:::/Zenith/DolDoc/DocPlain.HC,DataTagWidth"$.
|
||||
|
||||
,RT=I16 means the val is 2 bytes.
|
||||
See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
*/
|
||||
|
||||
I16 i=0;
|
||||
|
Binary file not shown.
@ -425,8 +425,8 @@ Squadron *SquadronLaunch(I64 player,F64 x=F64_MAX,F64 y=F64_MAX)
|
||||
if (player==0) {
|
||||
launch_unit_x1=tmpo->x;
|
||||
launch_unit_y1=tmpo->y;
|
||||
launch_unit_x2=ms.pos.x-main_task->pix_left-main_task->scroll_x;
|
||||
launch_unit_y2=ms.pos.y-main_task->pix_top -main_task->scroll_y;
|
||||
launch_unit_x2=mouse.pos.x-main_task->pix_left-main_task->scroll_x;
|
||||
launch_unit_y2=mouse.pos.y-main_task->pix_top -main_task->scroll_y;
|
||||
launch_t=tS+0.5;
|
||||
}
|
||||
if (tmpo->squadron>=0) {
|
||||
@ -494,8 +494,8 @@ Squadron *SquadronSet
|
||||
if (player==0) {
|
||||
set_é_unit_x1=tmpo->x;
|
||||
set_é_unit_y1=tmpo->y;
|
||||
set_é_unit_x2=ms.pos.x-main_task->pix_left-main_task->scroll_x;
|
||||
set_é_unit_y2=ms.pos.y-main_task->pix_top -main_task->scroll_y;
|
||||
set_é_unit_x2=mouse.pos.x-main_task->pix_left-main_task->scroll_x;
|
||||
set_é_unit_y2=mouse.pos.y-main_task->pix_top -main_task->scroll_y;
|
||||
set_é_t=tS+0.5;
|
||||
}
|
||||
if (tmpo->squadron>=0) {
|
||||
|
@ -152,12 +152,12 @@ U0 MassSpringDemo()
|
||||
break;
|
||||
case CH_SHIFT_ESC:
|
||||
case CH_ESC:
|
||||
goto ms_done;
|
||||
goto mouse_done;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
ms_done: //Don't goto out of try
|
||||
mouse_done: //Don't goto out of try
|
||||
GetMessage(,,1<<MESSAGE_KEY_UP);
|
||||
} catch
|
||||
PutExcept;
|
||||
|
@ -91,11 +91,11 @@ U0 Maze()
|
||||
do {
|
||||
MemSet(text,0,sizeof(text));
|
||||
while (!(ch=ScanChar)) {
|
||||
x=ms.pos_text.x-Fs->win_left-Fs->scroll_x/FONT_WIDTH;
|
||||
y=ms.pos_text.y-Fs->win_top-Fs->scroll_y/FONT_HEIGHT;
|
||||
if (ms.lb&&!winmgr.grab_scroll)
|
||||
x=mouse.pos_text.x-Fs->win_left-Fs->scroll_x/FONT_WIDTH;
|
||||
y=mouse.pos_text.y-Fs->win_top-Fs->scroll_y/FONT_HEIGHT;
|
||||
if (mouse.lb&&!winmgr.grab_scroll)
|
||||
text[y][x]=CH_SPACE+ATTRF_INVERT+ATTR;
|
||||
if (ms.rb&&!winmgr.grab_scroll) {
|
||||
if (mouse.rb&&!winmgr.grab_scroll) {
|
||||
text[y][x]='*'+ATTR;
|
||||
SolveMaze(x,y);
|
||||
ch=GetChar;
|
||||
|
@ -230,19 +230,19 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
dc->flags&=~(DCF_JUST_MIRROR|DCF_SYMMETRY);
|
||||
}
|
||||
|
||||
if (ms.pos.x-last_pos_x>0)
|
||||
if (mouse.pos.x-last_pos_x>0)
|
||||
left=FALSE;
|
||||
else if (ms.pos.x-last_pos_x<0)
|
||||
else if (mouse.pos.x-last_pos_x<0)
|
||||
left=TRUE;
|
||||
if (left) {
|
||||
dc->flags|=DCF_JUST_MIRROR|DCF_SYMMETRY;
|
||||
DCSymmetrySet(dc,ms.pos.x-task->pix_left-task->scroll_x,0,
|
||||
ms.pos.x-task->pix_left-task->scroll_x,1);
|
||||
DCSymmetrySet(dc,mouse.pos.x-task->pix_left-task->scroll_x,0,
|
||||
mouse.pos.x-task->pix_left-task->scroll_x,1);
|
||||
}
|
||||
Sprite3(dc,ms.pos.x-task->pix_left-task->scroll_x,
|
||||
ms.pos.y-task->pix_top -task->scroll_y,0,horse_imgs[frame&3]);
|
||||
Sprite3(dc,mouse.pos.x-task->pix_left-task->scroll_x,
|
||||
mouse.pos.y-task->pix_top -task->scroll_y,0,horse_imgs[frame&3]);
|
||||
dc->flags&=~(DCF_JUST_MIRROR|DCF_SYMMETRY);
|
||||
last_pos_x=ms.pos.x;
|
||||
last_pos_x=mouse.pos.x;
|
||||
|
||||
if (tf) {
|
||||
dc->color=RED;
|
||||
@ -336,8 +336,8 @@ U0 AnimateTask(CTask *parent)
|
||||
max_speed=ClampU64(max_speed,U32_MAX/3,200*U32_MAX);
|
||||
cx=(MAP_WIDTH -parent->pix_width)/2,
|
||||
cy=(MAP_HEIGHT-parent->pix_height)/2;
|
||||
cursor_x=ms.pos.x+cx-parent->pix_left-parent->scroll_x;
|
||||
cursor_y=ms.pos.y+cy-parent->pix_top -parent->scroll_y;
|
||||
cursor_x=mouse.pos.x+cx-parent->pix_left-parent->scroll_x;
|
||||
cursor_y=mouse.pos.y+cy-parent->pix_top -parent->scroll_y;
|
||||
count=0;stress=0;
|
||||
my_outside_count=0;
|
||||
if (cursor_x<FENCE_WIDTH && cursor_y<FENCE_HEIGHT)
|
||||
|
@ -962,11 +962,11 @@ Obj *FishFind(I64 x1,I64 y1,I64 *_dd)
|
||||
U0 AnimateTask(I64)
|
||||
{//Steadily moves the airplane fwd.
|
||||
I64 i,*s2w,x1,y1,z1,dx,dy,dz,dd;
|
||||
F64 t0=tS,ms,é,d;
|
||||
F64 t0=tS,mouse,é,d;
|
||||
Obj *tmpo;
|
||||
Bird *tmpb;
|
||||
while (TRUE) {
|
||||
ms=1000*(tS-t0);
|
||||
mouse=1000*(tS-t0);
|
||||
t0=tS;
|
||||
if (!game_tf) {
|
||||
//Screen to world coordinates
|
||||
@ -977,9 +977,9 @@ U0 AnimateTask(I64)
|
||||
|
||||
dx=0;dy=0;dz=1<<16;
|
||||
Mat4x4MulXYZ(s2w,&dx,&dy,&dz);
|
||||
x-=speed*ms*COORDINATE_SCALE*dx/1<<16;
|
||||
y-=speed*ms*COORDINATE_SCALE*dy/1<<16;
|
||||
z-=speed*ms*COORDINATE_SCALE*dz/1<<16;
|
||||
x-=speed*mouse*COORDINATE_SCALE*dx/1<<16;
|
||||
y-=speed*mouse*COORDINATE_SCALE*dy/1<<16;
|
||||
z-=speed*mouse*COORDINATE_SCALE*dz/1<<16;
|
||||
Free(s2w);
|
||||
x1=x/COORDINATE_SCALE; y1=y/COORDINATE_SCALE; z1=z/COORDINATE_SCALE;
|
||||
if (z1<(WATER_ELEVATION+3)*MAP_SCALE) {
|
||||
@ -987,9 +987,9 @@ U0 AnimateTask(I64)
|
||||
z=WATER_ELEVATION*MAP_SCALE*COORDINATE_SCALE;
|
||||
if (invert_pitch) {
|
||||
if (pitch<-ã/8)
|
||||
č+=ms/1000.0*Sign(3*ă/8-č);
|
||||
č+=mouse/1000.0*Sign(3*ă/8-č);
|
||||
} else if (pitch<-ã/8)
|
||||
č+=ms/1000.0*Sign(-3*ă/8-č);
|
||||
č+=mouse/1000.0*Sign(-3*ă/8-č);
|
||||
WrapAngles;
|
||||
}
|
||||
speed=1.0;
|
||||
@ -1031,11 +1031,11 @@ U0 AnimateTask(I64)
|
||||
for (i=0;i<mp_count;i++) {
|
||||
tmpb=b_head[i].next;
|
||||
while (tmpb!=&b_head[i]) {
|
||||
tmpb->p.x+=10*ms/1000*MAP_SCALE*Cos(tmpb->é);
|
||||
tmpb->p.y+=10*ms/1000*MAP_SCALE*Sin(tmpb->é);
|
||||
tmpb->p.x+=10*mouse/1000*MAP_SCALE*Cos(tmpb->é);
|
||||
tmpb->p.y+=10*mouse/1000*MAP_SCALE*Sin(tmpb->é);
|
||||
tmpb->p.z=BIRD_ELEVATION*MAP_SCALE+
|
||||
elevations[tmpb->p.y/MAP_SCALE][tmpb->p.x/MAP_SCALE];
|
||||
tmpb->é+=2*ă*ms/1000/10;
|
||||
tmpb->é+=2*ă*mouse/1000/10;
|
||||
tmpb=tmpb->next;
|
||||
}
|
||||
}
|
||||
|
@ -35,12 +35,12 @@ U0 DrawBoard(I64 player)
|
||||
break;
|
||||
|
||||
}
|
||||
//ms.pos.x,ms.pos.y are mouse x,y.
|
||||
//ms.lb is mouse left bttn
|
||||
//mouse.pos.x,mouse.pos.y are mouse x,y.
|
||||
//mouse.lb is mouse left bttn
|
||||
if (player==1)
|
||||
DrawX(dc,ms.pos.x-Fs->pix_left,ms.pos.y-Fs->pix_top);
|
||||
DrawX(dc,mouse.pos.x-Fs->pix_left,mouse.pos.y-Fs->pix_top);
|
||||
else
|
||||
DrawO(dc,ms.pos.x-Fs->pix_left,ms.pos.y-Fs->pix_top);
|
||||
DrawO(dc,mouse.pos.x-Fs->pix_left,mouse.pos.y-Fs->pix_top);
|
||||
DCDel(dc);
|
||||
}
|
||||
|
||||
@ -52,16 +52,16 @@ U0 TakeTurn(I64 player)
|
||||
Beep;
|
||||
else
|
||||
Beep(74);
|
||||
while (!ms.lb) {
|
||||
while (!mouse.lb) {
|
||||
DrawBoard(player);
|
||||
Refresh;
|
||||
}
|
||||
while (ms.lb) {
|
||||
while (mouse.lb) {
|
||||
DrawBoard(player);
|
||||
Refresh;
|
||||
}
|
||||
x=ms.pos.x-Fs->pix_left;
|
||||
y=ms.pos.y-Fs->pix_top;
|
||||
x=mouse.pos.x-Fs->pix_left;
|
||||
y=mouse.pos.y-Fs->pix_top;
|
||||
i=(x-100)/100+(y-100)/100*3;
|
||||
}
|
||||
board[i]=player;
|
||||
|
@ -23,8 +23,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
GrRect(dc,cx-BASE_SIZE+2,cy-BASE_SIZE+2,BASE_SIZE*2-4,BASE_SIZE*2-4);
|
||||
dc->color=YELLOW;
|
||||
GrLine(dc,balls[0].x,balls[0].y,
|
||||
ms.pos.x-task->pix_left-task->scroll_x,
|
||||
ms.pos.y-task->pix_top-task->scroll_y);
|
||||
mouse.pos.x-task->pix_left-task->scroll_x,
|
||||
mouse.pos.y-task->pix_top-task->scroll_y);
|
||||
for (i=0;i<SPRINGS_NUM;i++)
|
||||
GrLine(dc,springs[i].end1->x,springs[i].end1->y,
|
||||
springs[i].end2->x,springs[i].end2->y);
|
||||
@ -59,8 +59,8 @@ U0 MyDerivative(CMathODE *ode,F64 t,COrder2D3 *,COrder2D3 *)
|
||||
CTask *task=ode->win_task;
|
||||
|
||||
D3SubEqu(D3Equ(&p2,
|
||||
ms.pos.x-task->pix_left-task->scroll_x,
|
||||
ms.pos.y-task->pix_top-task->scroll_y,0),
|
||||
mouse.pos.x-task->pix_left-task->scroll_x,
|
||||
mouse.pos.y-task->pix_top-task->scroll_y,0),
|
||||
&balls[0].state->x);
|
||||
D3AddEqu(&balls[0].DstateDt->DxDt,D3MulEqu(&p2,STRETCH));
|
||||
|
||||
@ -129,8 +129,8 @@ U0 Whap()
|
||||
for (i=1;i<BALLS_NUM;i++)
|
||||
D3Equ(&balls[i].x,
|
||||
RandI16%500+Fs->pix_width>>1,RandI16%500+Fs->pix_height>>1,0);
|
||||
balls[0].x=ms.pos.x-Fs->pix_left-Fs->scroll_x;
|
||||
balls[0].y=ms.pos.y-Fs->pix_top-Fs->scroll_y;
|
||||
balls[0].x=mouse.pos.x-Fs->pix_left-Fs->scroll_x;
|
||||
balls[0].y=mouse.pos.y-Fs->pix_top-Fs->scroll_y;
|
||||
for (i=0;i<BALLS_NUM;i++) {
|
||||
balls[i].mass=1.0;
|
||||
balls[i].drag_profile_factor=1.0;
|
||||
|
Binary file not shown.
@ -9,12 +9,12 @@ U0 Main()
|
||||
while (!ScanChar) {
|
||||
DCDepthBufReset(dc);
|
||||
DCSymmetrySet(dc,Fs->pix_width/2,Fs->pix_height/2,
|
||||
ms.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
ms.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
mouse.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
mouse.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
dc->color=LTBLUE;
|
||||
GrLine(dc,Fs->pix_width/2,Fs->pix_height/2,
|
||||
ms.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
ms.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
mouse.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
mouse.pos.y-Fs->pix_top-Fs->scroll_y);
|
||||
|
||||
Mat4x4IdentEqu(dc->r);
|
||||
Mat4x4RotX(dc->r,ê);
|
||||
|
Binary file not shown.
@ -133,9 +133,9 @@ U0 FontEd()
|
||||
k=((arg2-BLOW_UP_CHAR_Y)/FONT_HEIGHT)*FONT_WIDTH+
|
||||
(arg1-BLOW_UP_CHAR_X)/FONT_WIDTH;
|
||||
if (0<=k<FONT_WIDTH*FONT_HEIGHT) {
|
||||
if (ms.lb||message_code==MESSAGE_MS_L_DOWN)
|
||||
if (mouse.lb||message_code==MESSAGE_MS_L_DOWN)
|
||||
Bts(&text.font[cur_ch],k);
|
||||
if (ms.rb||message_code==MESSAGE_MS_R_DOWN)
|
||||
if (mouse.rb||message_code==MESSAGE_MS_R_DOWN)
|
||||
Btr(&text.font[cur_ch],k);
|
||||
}
|
||||
break;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GRID 5
|
||||
|
||||
U0 DrawMyMs(CDC *dc,I64 x,I64 y)
|
||||
U0 DrawMyMouse(CDC *dc,I64 x,I64 y)
|
||||
{
|
||||
dc->thick=1;
|
||||
dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
|
||||
@ -10,21 +10,21 @@ U0 DrawMyMs(CDC *dc,I64 x,I64 y)
|
||||
U0 GridDemo()
|
||||
{
|
||||
CGridGlobals old_grid;
|
||||
U0 (*old_draw_ms)(CDC *dc,I64 x,I64 y); //Can't init this type of var.
|
||||
MemCpy(&old_grid,&ms_grid,sizeof(CGridGlobals));
|
||||
U0 (*old_draw_mouse)(CDC *dc,I64 x,I64 y); //Can't init this type of var.
|
||||
MemCpy(&old_grid,&mouse_grid,sizeof(CGridGlobals));
|
||||
GridInit;
|
||||
ms_grid.snap=TRUE; //You can set other $LK,"stuff",A="MN:CGridGlobals"$.
|
||||
ms_grid.x=GRID;
|
||||
ms_grid.y=GRID;
|
||||
old_draw_ms=gr.fp_draw_ms;
|
||||
gr.fp_draw_ms=&DrawMyMs;
|
||||
while (!ms.lb) {//Left bttn to exit.
|
||||
GrPlot(,ms.pos.x,ms.pos.y);
|
||||
mouse_grid.snap=TRUE; //You can set other $LK,"stuff",A="MN:CGridGlobals"$.
|
||||
mouse_grid.x=GRID;
|
||||
mouse_grid.y=GRID;
|
||||
old_draw_mouse=gr.fp_draw_mouse;
|
||||
gr.fp_draw_mouse=&DrawMyMouse;
|
||||
while (!mouse.lb) {//Left bttn to exit.
|
||||
GrPlot(,mouse.pos.x,mouse.pos.y);
|
||||
Yield;
|
||||
}
|
||||
DCFill;
|
||||
gr.fp_draw_ms=old_draw_ms;
|
||||
MemCpy(&ms_grid,&old_grid,sizeof(CGridGlobals));
|
||||
gr.fp_draw_mouse=old_draw_mouse;
|
||||
MemCpy(&mouse_grid,&old_grid,sizeof(CGridGlobals));
|
||||
}
|
||||
|
||||
GridDemo;
|
||||
|
@ -75,7 +75,7 @@ public U0 Life()
|
||||
while (message_code!=MESSAGE_MS_L_UP) {
|
||||
restart=TRUE;
|
||||
dc[cur_dc]->color=GREEN;
|
||||
dc[cur_dc]->thick=0.04*ms.speed;
|
||||
dc[cur_dc]->thick=0.04*mouse.speed;
|
||||
GrLine3(dc[cur_dc],x1,y1,0,x2,y2,0);
|
||||
restart=TRUE;
|
||||
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
|
||||
|
@ -1,8 +1,8 @@
|
||||
U0 Mouse()
|
||||
{
|
||||
"Press left mouse bttn to exit.\n";
|
||||
while (!ms.lb) { //Left bttn to exit.
|
||||
GrPlot(,ms.pos.x,ms.pos.y);
|
||||
while (!mouse.lb) { //Left bttn to exit.
|
||||
GrPlot(,mouse.pos.x,mouse.pos.y);
|
||||
Refresh;
|
||||
}
|
||||
DCFill;
|
||||
|
Binary file not shown.
@ -37,7 +37,7 @@ F64 F(Complex *x)
|
||||
CDiv(&n1,&num,&denom);
|
||||
|
||||
R2P(&m,&a,n1.x,n1.y);
|
||||
if (ms.rb)
|
||||
if (mouse.rb)
|
||||
return ã+a;
|
||||
else
|
||||
return m;
|
||||
|
@ -72,8 +72,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Mat4x4Scale(dc->r,tt);
|
||||
DCMat4x4Set(dc,dc->r);
|
||||
|
||||
ls.x=-(ms.pos.x-task->pix_left-task->scroll_x-cx);
|
||||
ls.y=-(ms.pos.y-task->pix_top-task->scroll_y-cy);
|
||||
ls.x=-(mouse.pos.x-task->pix_left-task->scroll_x-cx);
|
||||
ls.y=-(mouse.pos.y-task->pix_top-task->scroll_y-cy);
|
||||
ls.z=GR_WIDTH/8;
|
||||
d=1<<16/D3I32Norm(&ls);
|
||||
ls.x*=d;
|
||||
|
@ -28,7 +28,7 @@ public U0 SpeedLineDemo()
|
||||
x2=arg1; y2=arg2;
|
||||
count=0;
|
||||
while (message_code!=MESSAGE_MS_L_UP) {
|
||||
dc->thick=0.04*ms.speed;
|
||||
dc->thick=0.04*mouse.speed;
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
message_code=GetMessage(&arg1,&arg2,
|
||||
1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
|
||||
|
@ -1,13 +1,13 @@
|
||||
U0 InSetMsDemo()
|
||||
U0 InSetMouseDemo()
|
||||
{
|
||||
I64 t,l;
|
||||
WinBorder(ON);
|
||||
l=Fs->pix_left+Fs->scroll_x;
|
||||
t=Fs->pix_top+Fs->scroll_y;
|
||||
MsSet(,,,FALSE,FALSE); //Mouse unclicked
|
||||
InSetMs(,l-4,t-4);
|
||||
InSetMs(20,l+20,t+20,,TRUE);
|
||||
MsSet(,,,FALSE,FALSE);
|
||||
MouseSet(,,,FALSE,FALSE); //Mouse unclicked
|
||||
InSetMouse(,l-4,t-4);
|
||||
InSetMouse(20,l+20,t+20,,TRUE);
|
||||
MouseSet(,,,FALSE,FALSE);
|
||||
}
|
||||
|
||||
InSetMsDemo;
|
||||
InSetMouseDemo;
|
||||
|
@ -112,7 +112,7 @@ U0 ParseTerm(U8 **_src,U8 **_dst,I64 prec)
|
||||
|
||||
I64 Parse(U8 **_src,U8 **_dst)
|
||||
{//See $LK,"ParseExpression",A="MN:ParseExpression"$().
|
||||
//See $LK,"Opcode Fmts",A="FF:::/Compiler/OpCodes.DD,IDIV"$ for details on asm insts.
|
||||
//See $LK,"Opcode Formats",A="FF:::/Compiler/OpCodes.DD,IDIV"$ for details on asm insts.
|
||||
I64 i;
|
||||
U8 *dst=*_dst;
|
||||
switch (Lex(_src,&i)) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
U8 char_map[26]="22233344455566677778889999";
|
||||
|
||||
/*
|
||||
Fmt of word list entry:
|
||||
Format of word list entry:
|
||||
U8 ACD_WORD_CHAR
|
||||
U8 word[] with terminating zero
|
||||
I16 block; //definition offset in ::/Zenith/AutoComplete/ACDefs.DATA
|
||||
|
@ -1,8 +1,8 @@
|
||||
//ZenithOS supports standard $LK,"Print",A="MN:Print"$()
|
||||
//codes and extended ones.
|
||||
//See $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$.
|
||||
//See $LK,"Print(\"\") Format Strings",A="FI:::/Doc/Print.DD"$.
|
||||
|
||||
//Demonstrates $LK,"aux_fmt_num",A="FF:::/Doc/Print.DD,aux_fmt_num:2"$ codes.
|
||||
//Demonstrates $LK,"aux_format_num",A="FF:::/Doc/Print.DD,aux_format_num:2"$ codes.
|
||||
|
||||
"%10h?d\n",123456789;
|
||||
"%10h?d\n",12345;
|
||||
|
@ -21,7 +21,7 @@ U8 *SuggestMatchForm(U8 *src)
|
||||
return res;
|
||||
}
|
||||
|
||||
/*Fmt of word list entry:
|
||||
/*Format of word list entry:
|
||||
U8 ACD_WORD_CHAR
|
||||
U8 word[] with terminating zero
|
||||
I16 block; //definition offset in ::/Zenith/AutoComplete/ACDefs.DATA
|
||||
|
@ -90,7 +90,7 @@ I64 WordsCompare(U8 *e1,U8 *e2)
|
||||
return StrCmp(e1,e2);
|
||||
}
|
||||
|
||||
/*Fmt of word list entry:
|
||||
/*Format of word list entry:
|
||||
U8 ACD_WORD_CHAR
|
||||
U8 word[] with terminating zero
|
||||
I16 block; //definition offset in ::/Zenith/AutoComplete/ACDefs.DATA
|
||||
|
@ -124,9 +124,9 @@ public U0 CommPutBlk(I64 port,U8 *buf,I64 count)
|
||||
CommPutChar(port,*buf++);
|
||||
}
|
||||
|
||||
public U0 CommPrint(I64 port,U8 *fmt,...)
|
||||
public U0 CommPrint(I64 port,U8 *format,...)
|
||||
{
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
CommPutS(port,buf);
|
||||
Free(buf);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
$WW,1$* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,ms_hard.scale"$.
|
||||
$WW,1$* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,mouse_hard.scale"$.
|
||||
|
||||
* You can set your local time zone by setting the $FG,4$local_time_offset$FG$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.HC,local_time"$.
|
||||
|
||||
|
@ -127,7 +127,7 @@ $ID,2$Used for forms that prompt for data or just displaying a value. Use $FG,2
|
||||
|
||||
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$DA...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Zenith/DolDoc/DocEd.HC,&Fs->task_title"$.
|
||||
|
||||
The default raw data type for the $FG,2$$$DA...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
The default raw data type for the $FG,2$$$DA...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
|
||||
The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the print/scan format string.
|
||||
|
||||
@ -139,13 +139,13 @@ $ID,2$Used for forms. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc co
|
||||
|
||||
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$CB...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Zenith/DolDoc/DocEd.HC,&Fs->task_title"$.
|
||||
|
||||
The default raw data type for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
The default raw data type for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
$ID,-2$$TR,"LS List Widget"$
|
||||
$ID,2$Used for forms that prompt for data. You must specify a define list, $FG,2$D=""$FG$. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$format$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.HC"$.
|
||||
|
||||
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$LS...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the data addr. See $LK,"task_title",A="FF:::/Zenith/DolDoc/DocEd.HC,&Fs->task_title"$.
|
||||
|
||||
The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
$ID,-2$$TR,"MA Macro"$
|
||||
$ID,2$A left macro arg, $FG,2$LM=""$FG$, will send text when the left mouse is clicked.
|
||||
|
||||
@ -259,7 +259,7 @@ $FG,2$$$SP,"<1>",BI=1,BP="::/Demo/Graphics/Mountain.HC,Mountain"$$$FG$ will impo
|
||||
$ID,-2$$TR,"RT=<raw_data_type>"$
|
||||
$ID,2$The default data-type for the $FG,2$$$DA...$$$FG$ and $FG,2$$$LS...$$$FG$ commands is $FG,2$RT=I64$FG$. If you do not specify a raw type and are using $LK,"DocForm",A="MN:DocForm"$(), it will use the $FG,2$class$FG$ member's raw type, automatically. The default for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$.
|
||||
|
||||
If not using $LK,"DocForm",A="MN:DocForm"$(), change it to $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
If not using $LK,"DocForm",A="MN:DocForm"$(), change it to $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
$ID,-2$$TR,"SX=<Exp> Shift X"$
|
||||
$ID,2$Shift tag text $FG,2$+$FG$/$FG,2$- 7$FG$ X pixels off the grid.
|
||||
$ID,-2$$TR,"SY=<Exp> Shift Y"$
|
||||
|
@ -43,7 +43,7 @@ $ID,2$ZenithOS allocs mem as more items are displayed in the window. Also, Zeni
|
||||
$ID,-2$$TR,"Why do I get a memory leak when editing big files?"$
|
||||
$ID,2$The editor periodically takes a snap-shot of the document for $FG,2$UNDO$FG$ and this looks like a memory leak.
|
||||
$ID,-2$$TR,"Why is it in text mode?"$
|
||||
$ID,2$ZenithOS runs in $FG,2$VGA 640x480 16 color$FG$ graphics mode, not text mode. It changes to this mode with a $LK,"BIOS call",A="FF:::/Kernel/KStart16.HC,INT 0x10"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn by hand",A="MN:GrUpdateTextFG"$. See $LK,"::/Kernel/FontStd.HC"$. If graphics mode fails, it falls-back on text mode. You can force text mode with an $LK,"Kernel config",A="FI:::/Kernel/KCfg.HC"$ option.
|
||||
$ID,2$ZenithOS runs in $FG,2$VGA 640x480 16 color$FG$ graphics mode, not text mode. It changes to this mode with a $LK,"BIOS call",A="FF:::/Kernel/KStart16.HC,INT 0x10"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn by hand",A="MN:GrUpdateTextFG"$. See $LK,"::/Kernel/FontStd.HC"$. If graphics mode fails, it falls-back on text mode. You can force text mode with an $LK,"Kernel config",A="FI:::/Kernel/KConfig.HC"$ option.
|
||||
$ID,-2$$TR,"Where is the kernel memory?"$
|
||||
$ID,2$ZenithOS identity-maps all memory, all the time. It is like paging is not used. There is no special kernel $FG,2$high half$FG$ memory space. ZenithOS is ring-0-only, so everything is kernel, even user programs. There is a special task called $FG,2$Zenith$FG$ and he doesn't die, so his heap never gets freed. That's as close to $FG,2$kernel memory$FG$ as it gets. All code goes in the lowest 2Gig of addresses, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.DD,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. See $LK,"MemOverview",A="FI:::/Doc/MemOverview.DD"$.
|
||||
$ID,-2$$TR,"Why does it run code from stack addresses?"$
|
||||
|
@ -2,7 +2,7 @@ File
|
||||
{
|
||||
Rename(,'r');
|
||||
DirMk(,'d');
|
||||
FmtDrive(,'f');
|
||||
FormatDrive(,'f');
|
||||
UnmountDrive(,'u');
|
||||
Abort(,CH_SHIFT_ESC);
|
||||
Exit(,CH_ESC);
|
||||
|
@ -22,7 +22,7 @@ $FG,2$Bttn$FG$ Button
|
||||
$FG,2$Buf$FG$ Buffer
|
||||
$FG,2$Bwd$FG$ Backward
|
||||
$FG,2$CB$FG$ Call-Back, Code Block
|
||||
$FG,2$Cfg$FG$ Config
|
||||
$FG,2$Config$FG$ Config
|
||||
$FG,2$Change$FG$ Change
|
||||
$FG,2$Check$FG$ Check
|
||||
$FG,2$Clip$FG$ Clipboard
|
||||
@ -56,7 +56,7 @@ $FG,2$Exe$FG$ Execute
|
||||
$FG,2$Ext$FG$ Extern, Extended, Extract
|
||||
$FG,2$Feat$FG$ Feature
|
||||
$FG,2$FG$FG$ Foreground
|
||||
$FG,2$Fmt$FG$ Format
|
||||
$FG,2$Format$FG$ Format
|
||||
$FG,2$Fwd$FG$ Forward
|
||||
$FG,2$FPS$FG$ Frames per Second, First Person Shooter
|
||||
$FG,2$fp_$FG$ Function ptr
|
||||
@ -91,7 +91,7 @@ $FG,2$Mgr$FG$ Manager
|
||||
$FG,2$Mid$FG$ Middle
|
||||
$FG,2$Mon$FG$ Month
|
||||
$FG,2$MP$FG$ MultiProcessor
|
||||
$FG,2$Ms$FG$ Mouse
|
||||
$FG,2$Mouse$FG$ Mouse
|
||||
$FG,2$Message$FG$ Message
|
||||
$FG,2$Num$FG$ Number
|
||||
$FG,2$Obj$FG$ Object
|
||||
|
@ -20,7 +20,7 @@ $FG,2$/0000Boot$FG$ Boot files go here. Stage 2 of the ZenithOS hard drive mast
|
||||
|
||||
$FG,5$$TX+CX,"::/Home Files"$$FG$
|
||||
|
||||
The home dir is specified with $FG,2$'~'$FG$. The home dir is $FG,2$::/Home$FG$ unless you change it with $LK,"HomeSet",A="MN:HomeSet"$() or compile the kernel with a cfg option. An empty $FG,2$/Home$FG$ dir should be valid because it will get default files from the root dir.
|
||||
The home dir is specified with $FG,2$'~'$FG$. The home dir is $FG,2$::/Home$FG$ unless you change it with $LK,"HomeSet",A="MN:HomeSet"$() or compile the kernel with a config option. An empty $FG,2$/Home$FG$ dir should be valid because it will get default files from the root dir.
|
||||
|
||||
$LK,"~/PersonalMenu.DD"$ a menu viewed with the $FG,2$<CTRL-m>$FG$ key or by clicking "$FG,2$MENU$FG$" in the upper left border area of a window.
|
||||
|
||||
|
@ -1 +1 @@
|
||||
$WW,1$Recompile the kernel with $LK,"_CFG_HEAP_DBG",A="MN:_CFG_HEAP_DBG"$=TRUE if you want more heap debugging. You are on your own.
|
||||
$WW,1$Recompile the kernel with $LK,"_CONFIG_HEAP_DBG",A="MN:_CONFIG_HEAP_DBG"$=TRUE if you want more heap debugging. You are on your own.
|
||||
|
@ -31,7 +31,7 @@ MyPrint2("Hello","World");
|
||||
--------Hello.HC---------
|
||||
U0 MyPrint(U8 *st)
|
||||
{
|
||||
"" st; //Empty with no comma means first is fmt str.
|
||||
"" st; //Empty with no comma means first is format str.
|
||||
}
|
||||
MyPrint("Hello World\n");
|
||||
|
||||
|
Binary file not shown.
@ -32,22 +32,22 @@ $ID,2$$FG,2$U0 Test(I64 i=4,I64 j,I64 k=5)
|
||||
|
||||
Test(,3);$FG$
|
||||
$ID,-2$
|
||||
* A char const all alone is sent to $LK,"PutChars",A="MN:PutChars"$(). A string with or without args is sent to $LK,"Print",A="MN:Print"$(). An empty string literal signals a variable fmt_str follows.
|
||||
* A char const all alone is sent to $LK,"PutChars",A="MN:PutChars"$(). A string with or without args is sent to $LK,"Print",A="MN:Print"$(). An empty string literal signals a variable format_str follows.
|
||||
|
||||
$ID,2$$FG,2$void DemoC(char drv,char *fmt,char *name,int age)
|
||||
$ID,2$$FG,2$void DemoC(char drv,char *format,char *name,int age)
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
printf("%s age %d\n",name,age);
|
||||
printf(fmt,name,age);
|
||||
printf(format,name,age);
|
||||
putchar(drv);
|
||||
putchar('*');
|
||||
}
|
||||
|
||||
U0 DemoHolyC(U8 drv,U8 *fmt,U8 *name,I64 age)
|
||||
U0 DemoHolyC(U8 drv,U8 *format,U8 *name,I64 age)
|
||||
{
|
||||
"Hello World!\n";
|
||||
"%s age %d\n",name,age;
|
||||
"" fmt,name,age;
|
||||
"" format,name,age;
|
||||
'' drv;
|
||||
'*';
|
||||
}
|
||||
@ -87,9 +87,9 @@ $FG$>$FG,2$AddNums(1,2,3);$FG$
|
||||
ans=6
|
||||
$FG,2$
|
||||
|
||||
public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...)
|
||||
public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *format,...)
|
||||
{
|
||||
U8 *buf=$LK,"StrPrintJoin",A="MN:StrPrintJoin"$(NULL,fmt,argc,argv);//SPrintF() with $LK,"MAlloc",A="MN:MAlloc"$()ed string.
|
||||
U8 *buf=$LK,"StrPrintJoin",A="MN:StrPrintJoin"$(NULL,format,argc,argv);//SPrintF() with $LK,"MAlloc",A="MN:MAlloc"$()ed string.
|
||||
$LK,"GrPutS",A="MN:GrPutS"$(dc,x,y,buf); //Plot string at x,y pixels. GrPutS is not public.
|
||||
Free(buf);
|
||||
}
|
||||
@ -209,7 +209,7 @@ $FG$$ID,-2$
|
||||
|
||||
* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find dup local var type statements.
|
||||
|
||||
* With the $FG,2$#exe{}$FG$ feature in your src code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}",A="FF:::/Kernel/KMain.HC,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. $LK,"StreamPrint",A="MN:StreamPrint"$() places text into a src program stream following the conclusion of the $FG,2$#exe{}$FG$ blk.
|
||||
* With the $FG,2$#exe{}$FG$ feature in your src code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}",A="FF:::/Kernel/KMain.HC,#exe {"$ for an example where the date/time and compile-time prompting for configuration data is placed into a program. $LK,"StreamPrint",A="MN:StreamPrint"$() places text into a src program stream following the conclusion of the $FG,2$#exe{}$FG$ blk.
|
||||
|
||||
* No $FG,2$#define$FG$ functions exist (I'm not a fan)
|
||||
|
||||
@ -243,7 +243,7 @@ $FG$$ID,-2$
|
||||
|
||||
* Only one base class is allowed.
|
||||
|
||||
* $FG,2$printf()$FG$ has new codes. See $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$.
|
||||
* $FG,2$printf()$FG$ has new codes. See $LK,"Print(\"\") Format Strings",A="FI:::/Doc/Print.DD"$.
|
||||
|
||||
* All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values.
|
||||
|
||||
|
@ -23,7 +23,7 @@ $BK,1$WARNING:$BK,0$ This command erases everything on a hard drive. It repart
|
||||
|
||||
$BK,1$WARNING:$BK,0$ This command doesn't play well with other operating systems. You'll need to do a $LK,"BootMHDZero",A="MN:BootMHDZero"$() to restore your drive to a state where other operating systems can partition it.
|
||||
$ID,-2$
|
||||
$ID,-2$2) $LK,"Fmt",A="MN:Fmt"$($FG,2$'D'$FG$,$FG,2$TRUE,FALSE,FSt_FAT32$FG$)
|
||||
$ID,-2$2) $LK,"Format",A="MN:Format"$($FG,2$'D'$FG$,$FG,2$TRUE,FALSE,FSt_FAT32$FG$)
|
||||
$ID,2$This command formats a drive with $FG,2$FAT32$FG$ or the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system type. Use the drive letter of the partition in place of $FG,2$'D'$FG$.
|
||||
|
||||
$BK,1$WARNING:$BK,0$ If you are upgrading, be sure not to lose the file, $FG,2$/0000Boot/OldMBR.BIN.C$FG$.
|
||||
|
@ -1,16 +1,16 @@
|
||||
$WW,1$$LK,"ms.pos.x",A="MN:ms"$ and $LK,"ms.pos.y",A="MN:ms"$ can be used to access the x and y coordinates of the mouse. They are relative to the scrn, not window. These can be used if you don't want to use message passing. $LK,"ms.pos.z",A="MN:ms"$ is the wheel.
|
||||
$WW,1$$LK,"mouse.pos.x",A="MN:mouse"$ and $LK,"mouse.pos.y",A="MN:mouse"$ can be used to access the x and y coordinates of the mouse. They are relative to the scrn, not window. These can be used if you don't want to use message passing. $LK,"mouse.pos.z",A="MN:mouse"$ is the wheel.
|
||||
|
||||
$LK,"ms.pos_text.x",A="MN:CMsStateGlobals"$ and $LK,"ms.pos_text.y",A="MN:CMsStateGlobals"$ are the text column and row. See $LK,"::/Demo/Games/Maze.HC"$.
|
||||
$LK,"mouse.pos_text.x",A="MN:CMouseStateGlobals"$ and $LK,"mouse.pos_text.y",A="MN:CMouseStateGlobals"$ are the text column and row. See $LK,"::/Demo/Games/Maze.HC"$.
|
||||
|
||||
See $LK,"CMsStateGlobals",A="MN:CMsStateGlobals"$ and $LK,"CMsHardStateGlobals",A="MN:CMsHardStateGlobals"$.
|
||||
See $LK,"CMouseStateGlobals",A="MN:CMouseStateGlobals"$ and $LK,"CMouseHardStateGlobals",A="MN:CMouseHardStateGlobals"$.
|
||||
|
||||
The $FG,2$hard$FG$ designation, as in $FG,2$ms_hard$FG$, represents hardware layer items before the application of an abstraction layer.
|
||||
The $FG,2$hard$FG$ designation, as in $FG,2$mouse_hard$FG$, represents hardware layer items before the application of an abstraction layer.
|
||||
|
||||
$HL,1$//****
|
||||
ms_hard.pos.x=ms_hard.prescale.x*ms_hard.scale.x*ms_grid.x_speed;
|
||||
ms.presnap.x=ToI64(ms.scale.x*ms_hard.pos.x)+ms.offset.x;
|
||||
if (ms_grid.snap)
|
||||
ms.pos.x=Trunc(ms.presnap.x/ms_grid.x)*ms_grid.x+ms_grid.x_offset;
|
||||
mouse_hard.pos.x=mouse_hard.prescale.x*mouse_hard.scale.x*mouse_grid.x_speed;
|
||||
mouse.presnap.x=ToI64(mouse.scale.x*mouse_hard.pos.x)+mouse.offset.x;
|
||||
if (mouse_grid.snap)
|
||||
mouse.pos.x=Trunc(mouse.presnap.x/mouse_grid.x)*mouse_grid.x+mouse_grid.x_offset;
|
||||
else
|
||||
ms.pos.x=ms.presnap.x;
|
||||
mouse.pos.x=mouse.presnap.x;
|
||||
//****$HL,0$
|
||||
|
@ -1,6 +1,6 @@
|
||||
$WW,1$$FG,5$$TX+CX,"Print Fmt Strs"$$FG$
|
||||
$WW,1$$FG,5$$TX+CX,"Print Format Strs"$$FG$
|
||||
|
||||
<fmt_arg> := $FG,2$%$FG$[$FG,2$-$FG$][$FG,2$0$FG$][<width>][$FG,2$.$FG$<decimals>][<flags>][$FG,2$h$FG$<aux_fmt_num>]<fmt_code>
|
||||
<format_arg> := $FG,2$%$FG$[$FG,2$-$FG$][$FG,2$0$FG$][<width>][$FG,2$.$FG$<decimals>][<flags>][$FG,2$h$FG$<aux_format_num>]<format_code>
|
||||
|
||||
See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
|
||||
@ -11,15 +11,15 @@ $FG,2$','$FG$ add commas every three digits or four nibbles.
|
||||
$FG,2$'$$'$FG$ makes $FG,2$%Q$FG$ convert $FG,2$'$$'$FG$ to $FG,2$"\x24"$FG$.
|
||||
$FG,2$'/'$FG$ makes $FG,2$%Q$FG$ and $FG,2$%q$FG$ convert $FG,2$'%'$FG$ to $FG,2$"%%"$FG$.
|
||||
$ID,-2$
|
||||
<aux_fmt_num>:
|
||||
<aux_format_num>:
|
||||
|
||||
$ID,2$For $FG,2$"%n"$FG$, $FG,2$"%d"$FG$ or $FG,2$"%u"$FG$, the <aux_fmt_num> causes thousands mode. $FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$ will display milli units or $FG,2$"%h6n"$FG$ will display mega units. The $FG,2$'k'$FG$ flag is always on for $FG,2$"%n"$FG$. See $LK,"::/Demo/Print.HC"$.
|
||||
$ID,2$For $FG,2$"%n"$FG$, $FG,2$"%d"$FG$ or $FG,2$"%u"$FG$, the <aux_format_num> causes thousands mode. $FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$ will display milli units or $FG,2$"%h6n"$FG$ will display mega units. The $FG,2$'k'$FG$ flag is always on for $FG,2$"%n"$FG$. See $LK,"::/Demo/Print.HC"$.
|
||||
|
||||
For $FG,2$"%c"$FG$ or $FG,2$"%C"$FG$, the <aux_fmt_num> repeats the char that many times.$ID,-2$
|
||||
For $FG,2$"%c"$FG$ or $FG,2$"%C"$FG$, the <aux_format_num> repeats the char that many times.$ID,-2$
|
||||
|
||||
<fmt_code>:
|
||||
<format_code>:
|
||||
|
||||
$ID,2$$FG,2$"%n"$FG$ floating point in engineering notation, exponents being multiples of three. If it has a <aux_fmt> code, it will display scientific units letters.
|
||||
$ID,2$$FG,2$"%n"$FG$ floating point in engineering notation, exponents being multiples of three. If it has a <aux_format> code, it will display scientific units letters.
|
||||
|
||||
$FG,2$"%S"$FG$ $LK,"Define",A="MN:Define"$() entry.
|
||||
|
||||
@ -56,40 +56,40 @@ $ID,-2$
|
||||
|
||||
$FG,5$$TX+CX,"Print Family"$$FG$
|
||||
|
||||
$LK,"MStrPrint",A="MN:MStrPrint"$(U8 *fmt,...) is like $LK,"StrPrint",A="MN:StrPrint"$(U8 *dst,U8 *fmt,...) but it returns a $LK,"MAlloc",A="MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow.
|
||||
$LK,"MStrPrint",A="MN:MStrPrint"$(U8 *format,...) is like $LK,"StrPrint",A="MN:StrPrint"$(U8 *dst,U8 *format,...) but it returns a $LK,"MAlloc",A="MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow.
|
||||
|
||||
$LK,"CatPrint",A="MN:CatPrint"$(U8 *_dst,U8 *fmt,...) concatenates a formated string.
|
||||
$LK,"CatPrint",A="MN:CatPrint"$(U8 *_dst,U8 *format,...) concatenates a formated string.
|
||||
|
||||
$LK,"In",A="MN:In"$(U8 *fmt,...) sends text to the current task's input buffer.
|
||||
$LK,"InStr",A="MN:InStr"$(U8 *fmt,...) sends text of an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$ to the keyboard stream of the current TASK but can also do mouse cmds.
|
||||
$LK,"In",A="MN:In"$(U8 *format,...) sends text to the current task's input buffer.
|
||||
$LK,"InStr",A="MN:InStr"$(U8 *format,...) sends text of an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$ to the keyboard stream of the current TASK but can also do mouse cmds.
|
||||
|
||||
$LK,"XTalk",A="MN:XTalk"$(CTask *task,U8 *fmt,...) and text to another task's input buffer.
|
||||
$LK,"XTalkStr",A="MN:XTalkStr"$(CTask *task,U8 *fmt,...) sends text of an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$ to the keyboard stream of another TASK but can also do mouse cmds.
|
||||
$LK,"XTalk",A="MN:XTalk"$(CTask *task,U8 *format,...) and text to another task's input buffer.
|
||||
$LK,"XTalkStr",A="MN:XTalkStr"$(CTask *task,U8 *format,...) sends text of an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$ to the keyboard stream of another TASK but can also do mouse cmds.
|
||||
|
||||
$LK,"DocPrint",A="MN:DocPrint"$(CDoc *doc,U8 *fmt,...) sends text to a document. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK,"::/Demo/Disk/FPrintF.HC"$.
|
||||
$LK,"DocPrint",A="MN:DocPrint"$(CDoc *doc,U8 *format,...) sends text to a document. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK,"::/Demo/Disk/FPrintF.HC"$.
|
||||
|
||||
$LK,"Zenith",A="MN:Zenith"$(U8 *fmt,...) sends text to the $LK,"Zenith Task",A="FF:::/Doc/Glossary.DD,Zenith Task"$ to be compiled and run.
|
||||
$LK,"ZenithLog",A="MN:ZenithLog"$(U8 *fmt,...) and $LK,"ZenithErr",A="MN:ZenithErr"$(U8 *fmt,...) send text to the $LK,"Zenith Task",A="FF:::/Doc/Glossary.DD,Zenith Task"$ to be displayed.
|
||||
$LK,"Zenith",A="MN:Zenith"$(U8 *format,...) sends text to the $LK,"Zenith Task",A="FF:::/Doc/Glossary.DD,Zenith Task"$ to be compiled and run.
|
||||
$LK,"ZenithLog",A="MN:ZenithLog"$(U8 *format,...) and $LK,"ZenithErr",A="MN:ZenithErr"$(U8 *format,...) send text to the $LK,"Zenith Task",A="FF:::/Doc/Glossary.DD,Zenith Task"$ to be displayed.
|
||||
|
||||
$LK,"StreamPrint",A="MN:StreamPrint"$(U8 *fmt,...) sends text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk.
|
||||
$LK,"StreamPrint",A="MN:StreamPrint"$(U8 *format,...) sends text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk.
|
||||
|
||||
$LK,"GrPrint",A="MN:GrPrint"$(CDC *dc,I64 x,I64 y,U8 *fmt,...) and $LK,"GrVPrint",A="MN:GrVPrint"$() plots text in graphics mode.
|
||||
$LK,"GrPrint",A="MN:GrPrint"$(CDC *dc,I64 x,I64 y,U8 *format,...) and $LK,"GrVPrint",A="MN:GrVPrint"$() plots text in graphics mode.
|
||||
|
||||
$LK,"TextPrint",A="MN:TextPrint"$(CTask *task,I64 x,I64 y,I64 attr,U8 *fmt,...) plots to $LK,"gr.text_base",A="HI:TextBase Layer"$.
|
||||
$LK,"TextPrint",A="MN:TextPrint"$(CTask *task,I64 x,I64 y,I64 attr,U8 *format,...) plots to $LK,"gr.text_base",A="HI:TextBase Layer"$.
|
||||
|
||||
$LK,"ExePrint",A="MN:ExePrint"$(U8 *fmt,...) compiles and execute a string. Note: It returns the res of the last executed expression.
|
||||
$LK,"ExePrint",A="MN:ExePrint"$(U8 *format,...) compiles and execute a string. Note: It returns the res of the last executed expression.
|
||||
|
||||
$LK,"Once",A="MN:Once"$(U8 *fmt,...) Writes User code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
|
||||
$LK,"Once",A="MN:Once"$(U8 *format,...) Writes User code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
|
||||
|
||||
$LK,"AOnce",A="MN:AOnce"$(U8 *fmt,...) Writes Zenith code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
|
||||
$LK,"AOnce",A="MN:AOnce"$(U8 *format,...) Writes Zenith code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
|
||||
|
||||
$LK,"InPrint",A="MN:InPrint"$(I64 mS,U8 *fmt,...) $LK,"PutChars",A="MN:PutChars"$()s one at a time with a delay.
|
||||
$LK,"InPrint",A="MN:InPrint"$(I64 mS,U8 *format,...) $LK,"PutChars",A="MN:PutChars"$()s one at a time with a delay.
|
||||
|
||||
$LK,"RawPrint",A="MN:RawPrint"$(I64 mS,U8 *fmt,...) sends direct to scrn memory, bypassing window manager.
|
||||
$LK,"RawPrint",A="MN:RawPrint"$(I64 mS,U8 *format,...) sends direct to scrn memory, bypassing window manager.
|
||||
|
||||
$LK,"User",A="MN:User"$(U8 *fmt,...) Spawns a user and execute a string on start-up.
|
||||
$LK,"User",A="MN:User"$(U8 *format,...) Spawns a user and execute a string on start-up.
|
||||
|
||||
$LK,"PopUpPrint",A="MN:PopUpPrint"$(U8 *fmt,...) compiles and execute a string in a pop-up win. Note: It returns the res of the last executed expression.
|
||||
$LK,"PopUpViewPrint",A="MN:PopUpViewPrint"$(U8 *fmt,...) creates a pop-up window and views text.
|
||||
$LK,"PopUpPrint",A="MN:PopUpPrint"$(U8 *format,...) compiles and execute a string in a pop-up win. Note: It returns the res of the last executed expression.
|
||||
$LK,"PopUpViewPrint",A="MN:PopUpViewPrint"$(U8 *format,...) creates a pop-up window and views text.
|
||||
|
||||
$BK,1$Note:$BK,0$ Use $FG,2$Print("%s",src)$FG$ if you need an unmodified string.
|
||||
|
@ -21,7 +21,7 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
|
||||
|
||||
* Use the PullDown menu at the top of the scrn to learn commands, or for finding the keyboard controls to games.
|
||||
|
||||
* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,ms_hard.scale"$.
|
||||
* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,mouse_hard.scale"$.
|
||||
|
||||
* You can set your local time zone by setting the $LK,"local_time_offset",A="MN:local_time_offset"$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.HC,local_time"$.
|
||||
|
||||
@ -29,9 +29,9 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
|
||||
|
||||
* You can use $FG,2$filter_lines$FG$ in the editor text search form ($FG,2$<CTRL-f>$FG$) to temporarily display just lines near each match. A value of $FG,2$filter lines$FG$ set to $FG,2$5$FG$ will display lines within 5 lines of matches. Then, you can do another find to a different string and achieve a $FG,2$AND$FG$ search. When finished, press $FG,2$<ESC>$FG$.
|
||||
|
||||
* You can recompile and reinstall the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). You'll probably want to make a function for recompiling that uses the $LK,"In",A="MN:In"$() function to answer the cfg questions. See my technique $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.
|
||||
* You can recompile and reinstall the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). You'll probably want to make a function for recompiling that uses the $LK,"In",A="MN:In"$() function to answer the config questions. See my technique $LK,"Config Strs",A="FL:::/Demo/AcctExample/TOS/TOSConfig.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.
|
||||
|
||||
* $LK,"Scale2Mem",A="MN:Scale2Mem"$(min,max,limit=2*1024*1024*1024) can be used for cfg questions when recompiling. The $LK,"BootHDIns",A="MN:BootHDIns"$() cfg prompts accept expressions, not just numbers. The default disk cache is $FG,2$Scale2Mem(0x80000,0x8000000)$FG$.
|
||||
* $LK,"Scale2Mem",A="MN:Scale2Mem"$(min,max,limit=2*1024*1024*1024) can be used for config questions when recompiling. The $LK,"BootHDIns",A="MN:BootHDIns"$() config prompts accept expressions, not just numbers. The default disk cache is $FG,2$Scale2Mem(0x80000,0x8000000)$FG$.
|
||||
|
||||
* You can permanently disable $FG,2$AutoComplete$FG$ commenting-out $LK,"ACInit",A="FF:/Home/HomeSys.HC,ACInit"$() in $LK,"~/HomeSys.HC",A="FF:/Home/HomeSys.HC,ACInit"$.
|
||||
|
||||
@ -129,7 +129,7 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
|
||||
|
||||
* Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$() to find leaks. Don't be confused by $LK,"CDoc",A="MN:CDoc"$ allocations. Those are generated when text is written to the cmd line buffer.
|
||||
|
||||
* For advanced heap debugging, play with $LK,"_CFG_HEAP_DBG",A="MN:_CFG_HEAP_DBG"$. You're on your own.
|
||||
* For advanced heap debugging, play with $LK,"_CONFIG_HEAP_DBG",A="MN:_CONFIG_HEAP_DBG"$. You're on your own.
|
||||
|
||||
* You can use $LK,"Type",A="MN:Type"$() to display $FG,2$.GR$FG$ files.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
//Make Your own Distro by #include-ing this file.
|
||||
|
||||
#define STD_DISTRO_DVD_CFG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
|
||||
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
|
||||
|
||||
U0 MakeMyISO(U8 *_out_iso_filename)
|
||||
{//Does everything with current drive.
|
||||
@ -14,7 +14,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
|
||||
Del(out_iso_filename);
|
||||
|
||||
DirMk("/Distro");
|
||||
In(STD_DISTRO_DVD_CFG);
|
||||
In(STD_DISTRO_DVD_CONFIG);
|
||||
BootDVDIns;
|
||||
|
||||
Copy("/*","/Distro");
|
||||
@ -46,4 +46,4 @@ U0 MakeMyISO(U8 *_out_iso_filename)
|
||||
|
||||
MakeMyISO("/Tmp/MyDistro.ISO.C");
|
||||
|
||||
// Study my account examples $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.
|
||||
// Study my account examples $LK,"Config Strs",A="FL:::/Demo/AcctExample/TOS/TOSConfig.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.
|
||||
|
@ -8,12 +8,12 @@ KbdTypeMatic(0);
|
||||
local_time_offset=0*60*60*CDATE_FREQ; //Do daylight savings by hand
|
||||
|
||||
//$AN,"",A="mouse_move_scale"$adjust these to set mouse move scale
|
||||
ms_hard.scale.x=0.5;
|
||||
ms_hard.scale.y=0.5;
|
||||
ms_hard.scale.z=1.0; //wheel
|
||||
mouse_hard.scale.x=0.5;
|
||||
mouse_hard.scale.y=0.5;
|
||||
mouse_hard.scale.z=1.0; //wheel
|
||||
|
||||
//don't change these
|
||||
ms_hard.prescale.x=ms_hard.pos.x/ms_hard.scale.x;
|
||||
ms_hard.prescale.y=ms_hard.pos.y/ms_hard.scale.y;
|
||||
ms_hard.prescale.z=ms_hard.pos.z/ms_hard.scale.z;
|
||||
mouse_hard.prescale.x=mouse_hard.pos.x/mouse_hard.scale.x;
|
||||
mouse_hard.prescale.y=mouse_hard.pos.y/mouse_hard.scale.y;
|
||||
mouse_hard.prescale.z=mouse_hard.pos.z/mouse_hard.scale.z;
|
||||
|
||||
|
BIN
src/Kernel.BIN.C
BIN
src/Kernel.BIN.C
Binary file not shown.
@ -103,7 +103,7 @@ Bool ATAGetRes(CBlkDev *bd,F64 timeout,U8 *buf,I64 count,
|
||||
return ATAWaitNotBUSY(bd,timeout);
|
||||
}
|
||||
|
||||
Bool ATAPIWritePktWord(CBlkDev *bd,F64 timeout,...)
|
||||
Bool ATAPIWritePacketWord(CBlkDev *bd,F64 timeout,...)
|
||||
{
|
||||
I64 i;
|
||||
for (i=0;i<argc;i++) {
|
||||
@ -124,7 +124,7 @@ Bool ATAPISetMaxSpeed(CBlkDev *bd)
|
||||
OutU8(bd->base0+ATAR0_LCYL,0);
|
||||
OutU8(bd->base0+ATAR0_HCYL,0);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0xBB00,0xFFFF,0xFFFF,0,0,0);
|
||||
ATAPIWritePacketWord(bd,0,0xBB00,0xFFFF,0xFFFF,0,0,0);
|
||||
return ATAWaitNotBUSY(bd,0);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ Bool ATAPISeek(CBlkDev *bd,I64 native_blk)
|
||||
OutU8(bd->base0+ATAR0_LCYL,0);
|
||||
OutU8(bd->base0+ATAR0_HCYL,0);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0x2B00,native_blk>>16,native_blk,0,0,0);
|
||||
ATAPIWritePacketWord(bd,0,0x2B00,native_blk>>16,native_blk,0,0,0);
|
||||
return ATAWaitNotBUSY(bd,0);
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ Bool ATAPIStartStop(CBlkDev *bd,F64 timeout,Bool start)
|
||||
OutU8(bd->base0+ATAR0_SEL,0xE0|bd->unit<<4);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
//Start/Stop
|
||||
if (ATAPIWritePktWord(bd,timeout,0x1B00,0,i,0,0,0))
|
||||
if (ATAPIWritePacketWord(bd,timeout,0x1B00,0,i,0,0,0))
|
||||
return ATAWaitNotBUSY(bd,timeout);
|
||||
else
|
||||
return FALSE;
|
||||
@ -267,7 +267,7 @@ I64 ATAPIReadCapacity(CBlkDev *bd,I64 *_blk_size=NULL)
|
||||
OutU8(bd->base0+ATAR0_LCYL,8);
|
||||
OutU8(bd->base0+ATAR0_HCYL,0);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0x2500,0,0,0,0,0);
|
||||
ATAPIWritePacketWord(bd,0,0x2500,0,0,0,0,0);
|
||||
if (!ATAGetRes(bd,0,buf,8,0,TRUE))
|
||||
buf[0]=buf[1]=0;
|
||||
} else
|
||||
@ -290,7 +290,7 @@ CATAPITrack *ATAPIReadTrackInfo(CBlkDev *bd,I64 blk)
|
||||
OutU8(bd->base0+ATAR0_LCYL,sizeof(CATAPITrack)&0xFF);
|
||||
OutU8(bd->base0+ATAR0_HCYL,sizeof(CATAPITrack)>>8);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0x5200,blk.u16[1],blk.u16[0],
|
||||
ATAPIWritePacketWord(bd,0,0x5200,blk.u16[1],blk.u16[0],
|
||||
(sizeof(CATAPITrack)&0xFF00)>>8,(sizeof(CATAPITrack)&0x00FF)<<8,0);
|
||||
if (!ATAGetRes(bd,0,res,sizeof(CATAPITrack),0,TRUE)) {
|
||||
Free(res);
|
||||
@ -401,7 +401,7 @@ Bool ATAPIReadBlks2(CBlkDev *bd,F64 timeout,U8 *buf,
|
||||
OutU8(bd->base0+ATAR0_LCYL,bd->blk_size);
|
||||
OutU8(bd->base0+ATAR0_HCYL,bd->blk_size.u8[1]);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
if (ATAPIWritePktWord(bd,timeout,0xA800,
|
||||
if (ATAPIWritePacketWord(bd,timeout,0xA800,
|
||||
native_blk.u16[1],native_blk,count.u16[1],count,0) &&
|
||||
ATAGetRes(bd,timeout,buf,count*bd->blk_size,0,FALSE)) {
|
||||
blkdev.read_count+=(count*bd->blk_size)>>BLK_SIZE_BITS;
|
||||
@ -514,7 +514,7 @@ Bool ATAPISync(CBlkDev *bd)
|
||||
OutU8(bd->base0+ATAR0_LCYL,0);
|
||||
OutU8(bd->base0+ATAR0_HCYL,0);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0x3500,0,0,0,0,0);
|
||||
ATAPIWritePacketWord(bd,0,0x3500,0,0,0,0,0);
|
||||
if (!ATAWaitNotBUSY(bd,0))
|
||||
okay=FALSE;
|
||||
}
|
||||
@ -531,7 +531,7 @@ U0 ATAPIClose(CBlkDev *bd,I64 close_field=0x200,I64 track=0)
|
||||
OutU8(bd->base0+ATAR0_LCYL,0);
|
||||
OutU8(bd->base0+ATAR0_HCYL,0);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0x5B00,close_field,track,0,0,0);
|
||||
ATAPIWritePacketWord(bd,0,0x5B00,close_field,track,0,0,0);
|
||||
ATAWaitNotBUSY(bd,0);
|
||||
}
|
||||
|
||||
@ -550,7 +550,7 @@ U0 ATAPIWriteBlks(CBlkDev *bd,U8 *buf, I64 native_blk, I64 count)
|
||||
else
|
||||
OutU8(bd->base0+ATAR0_SEL,0xE0|bd->unit<<4);
|
||||
OutU8(bd->base0+ATAR0_CMD,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0x0400,native_blk.u16[1],native_blk,count.u16[1],count,0);
|
||||
ATAPIWritePacketWord(bd,0,0x0400,native_blk.u16[1],native_blk,count.u16[1],count,0);
|
||||
bd->flags|=BDF_LAST_WAS_WRITE;
|
||||
ATAWaitNotBUSY(bd,0);
|
||||
|
||||
@ -563,7 +563,7 @@ U0 ATAPIWriteBlks(CBlkDev *bd,U8 *buf, I64 native_blk, I64 count)
|
||||
OutU8(bd->base0+ATAR0_LCYL,bd->blk_size);
|
||||
OutU8(bd->base0+ATAR0_HCYL,bd->blk_size.u8[1]);
|
||||
ATACmd(bd,ATA_PACKET);
|
||||
ATAPIWritePktWord(bd,0,0xAA00,native_blk.u16[1],native_blk,count.u16[1],count,0);
|
||||
ATAPIWritePacketWord(bd,0,0xAA00,native_blk.u16[1],native_blk,count.u16[1],count,0);
|
||||
buf2=buf+bd->blk_size*count;
|
||||
while (buf<buf2) {
|
||||
ATAWaitDRQ(bd,0);
|
||||
|
@ -261,7 +261,7 @@ CBlkDev *ATAMount(U8 first_drive_let,I64 type,I64 base0,I64 base1,I64 unit)
|
||||
}
|
||||
|
||||
I64 MountIDEAuto()
|
||||
{//Try to mount hard drive and CD/DVD, automatically. (Kernel.Cfg option).
|
||||
{//Try to mount hard drive and CD/DVD, automatically. (Kernel.Config option).
|
||||
//It uses 'C' and 'T' as first drive letters or whatever you set
|
||||
//in config when compiling Kernel.BIN.
|
||||
I64 res=0;
|
||||
|
@ -188,7 +188,7 @@ Bool GetBaseUnit(CBlkDev *bd)
|
||||
I64 ch;
|
||||
Bool probe;
|
||||
#exe {
|
||||
if (kernel_cfg->opts[CFG_DONT_PROBE])
|
||||
if (kernel_config->opts[CONFIG_DONT_PROBE])
|
||||
StreamPrint("probe=FALSE;");
|
||||
else
|
||||
StreamPrint("probe=TRUE;");
|
||||
@ -231,10 +231,10 @@ U0 BlkDevsInitAll()
|
||||
for (i=0;i<DRIVES_NUM;i++)
|
||||
blkdev.let_to_drive[i]=&blkdev.drvs[i];
|
||||
#exe {
|
||||
if (kernel_cfg->opts[CFG_MOUNT_IDE_AUTO])
|
||||
if (kernel_config->opts[CONFIG_MOUNT_IDE_AUTO])
|
||||
StreamPrint("MountIDEAuto;");
|
||||
StreamPrint("#exe {Option(OPTf_WARN_PAREN,OFF);}");
|
||||
StreamDoc(kernel_cfg->add_dev);
|
||||
StreamDoc(kernel_config->add_dev);
|
||||
StreamPrint("#exe {Option(OPTf_WARN_PAREN,ON);}");
|
||||
};
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ Bool BlkDevInit(CBlkDev *bd)
|
||||
if (RedSeaValidate(bd->first_drive_let))
|
||||
RedSeaInit(drive);
|
||||
else
|
||||
RedSeaFmt(bd->first_drive_let);
|
||||
RedSeaFormat(bd->first_drive_let);
|
||||
res=TRUE;
|
||||
break;
|
||||
case BDT_ISO_FILE_READ:
|
||||
@ -81,7 +81,7 @@ Bool BlkDevInit(CBlkDev *bd)
|
||||
bd->file_disk=FOpen(bd->file_disk_name,"wc",bd->max_blk+1);
|
||||
drive->fs_type=FSt_REDSEA;
|
||||
drive->size=bd->max_blk+1-bd->drv_offset;
|
||||
RedSeaFmt(bd->first_drive_let);
|
||||
RedSeaFormat(bd->first_drive_let);
|
||||
CallExtStr("RedSeaISO9660",bd->file_disk_name,bd->first_drive_let);
|
||||
res=TRUE;
|
||||
break;
|
||||
|
@ -52,7 +52,7 @@ Bool DriveTypeSet(U8 drv_let,I64 type=FSt_REDSEA)
|
||||
}
|
||||
}
|
||||
|
||||
U0 Fmt(I64 drv_let,Bool quick=TRUE,Bool confirm=TRUE,I64 type=FSt_FAT32)
|
||||
U0 Format(I64 drv_let,Bool quick=TRUE,Bool confirm=TRUE,I64 type=FSt_FAT32)
|
||||
{//Format hard drive or RAM drive.
|
||||
//$BK,1$Warning:$BK,0$ Destroys all prev info.
|
||||
//quick=FALSE means fill entire drive with zeros.
|
||||
@ -72,7 +72,7 @@ U0 Fmt(I64 drv_let,Bool quick=TRUE,Bool confirm=TRUE,I64 type=FSt_FAT32)
|
||||
Silent;
|
||||
Drive(drv_let);
|
||||
Silent(old_silent);
|
||||
FAT32Fmt(drv_let,quick);
|
||||
FAT32Format(drv_let,quick);
|
||||
DiskCacheInvalidate(Letter2Drive(drv_let));
|
||||
Drive(drv_let);
|
||||
break;
|
||||
@ -82,7 +82,7 @@ U0 Fmt(I64 drv_let,Bool quick=TRUE,Bool confirm=TRUE,I64 type=FSt_FAT32)
|
||||
Silent;
|
||||
Drive(drv_let);
|
||||
Silent(old_silent);
|
||||
RedSeaFmt(drv_let,quick);
|
||||
RedSeaFormat(drv_let,quick);
|
||||
DiskCacheInvalidate(Letter2Drive(drv_let));
|
||||
Drive(drv_let);
|
||||
break;
|
@ -45,7 +45,7 @@ U0 FAT32Init(CDrive *drive)
|
||||
DriveUnlock(drive);
|
||||
}
|
||||
|
||||
U0 FAT32Fmt(U8 drv_let,Bool quick=TRUE)
|
||||
U0 FAT32Format(U8 drv_let,Bool quick=TRUE)
|
||||
{
|
||||
CFAT32Boot *br=CAlloc(BLK_SIZE);
|
||||
CFAT32FileInfoSect *fis=CAlloc(BLK_SIZE);
|
||||
|
@ -91,7 +91,7 @@ Bool RedSeaValidate(U8 drv_let)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
U0 RedSeaFmt(U8 drv_let,Bool quick=TRUE)
|
||||
U0 RedSeaFormat(U8 drv_let,Bool quick=TRUE)
|
||||
{
|
||||
U8 *root_dir;
|
||||
CDirEntry *d_native;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "DiskATA"
|
||||
#include "DiskATAId"
|
||||
#include "DiskBlkDev"
|
||||
#include "DiskDrive"
|
||||
#include "DiskDrive"
|
||||
#include "DiskBlk"
|
||||
#include "DiskClus"
|
||||
#include "DiskStrB"
|
||||
@ -19,5 +19,5 @@
|
||||
#include "DiskCFile"
|
||||
#include "DiskCopy"
|
||||
#include "DiskCDDVD"
|
||||
#include "DiskFmt"
|
||||
#include "DiskFormat"
|
||||
#exe {Cd("..");};
|
||||
|
@ -394,19 +394,19 @@ I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL)
|
||||
}
|
||||
}
|
||||
|
||||
I64 PopUpPrint(U8 *fmt,...)
|
||||
I64 PopUpPrint(U8 *format,...)
|
||||
{//Execute code in $LK,"PopUp",A="MN:PopUp"$ task.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
I64 res;
|
||||
res=PopUp(buf,Fs);
|
||||
Free(buf);
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 Zenith(U8 *fmt,...)
|
||||
I64 Zenith(U8 *format,...)
|
||||
{//Make zenith_task execute code.
|
||||
I64 res;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
CJob *tmpc;
|
||||
if (Fs==zenith_task) {
|
||||
tmpc=TaskExe(zenith_task,Fs,buf,0);
|
||||
@ -420,9 +420,9 @@ I64 Zenith(U8 *fmt,...)
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 ZenithLog(U8 *fmt,...)
|
||||
U0 ZenithLog(U8 *format,...)
|
||||
{//Display text in zenith_task.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
if (Fs==zenith_task)
|
||||
"%s",buf;
|
||||
else if (!IsSingleUser)
|
||||
@ -430,9 +430,9 @@ U0 ZenithLog(U8 *fmt,...)
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U0 ZenithErr(U8 *fmt,...)
|
||||
U0 ZenithErr(U8 *format,...)
|
||||
{//Display red blinking Err text in zenith_task.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv),
|
||||
*st=MStrPrint(ST_ERR_ST "%s",buf);
|
||||
if (Fs==zenith_task)
|
||||
"%s",st;
|
||||
@ -442,18 +442,18 @@ U0 ZenithErr(U8 *fmt,...)
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U0 XTalk(CTask *task,U8 *fmt,...)
|
||||
U0 XTalk(CTask *task,U8 *format,...)
|
||||
{//Sends text to other task. See $LK,"::/Misc/OSTestSuite.HC"$.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=ZStrNew(buf),
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv),*st=ZStrNew(buf),
|
||||
*st2=MStrPrint("\"%%s\",%d;Free(%d);",st,st);
|
||||
TaskText(task,NULL,st2,0);
|
||||
Free(st2);
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U0 XTalkWait(CTask *task,U8 *fmt,...)
|
||||
U0 XTalkWait(CTask *task,U8 *format,...)
|
||||
{//Send text to other task and wait for it to idle.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=ZStrNew(buf),
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv),*st=ZStrNew(buf),
|
||||
*st2=MStrPrint("\"%%s\",%d;Free(%d);",st,st);
|
||||
TaskText(task,NULL,st2,0);
|
||||
Free(st2);
|
||||
@ -461,9 +461,9 @@ U0 XTalkWait(CTask *task,U8 *fmt,...)
|
||||
TaskWait(task);
|
||||
}
|
||||
|
||||
U0 InStr(U8 *fmt,...)
|
||||
U0 InStr(U8 *format,...)
|
||||
{//Send InFile code to self.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
if (Bt(&Fs->task_flags,TASKf_INPUT_FILTER_TASK))
|
||||
ExePrint("%s",buf);
|
||||
else
|
||||
@ -479,23 +479,23 @@ U0 InFile(U8 *filename)
|
||||
Free(name);
|
||||
}
|
||||
|
||||
U0 In(U8 *fmt,...)
|
||||
U0 In(U8 *format,...)
|
||||
{//Send text to own input buffer. See $LK,"::/Demo/AcctExample/TOS/TOSDistro.HC"$.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=ZStrNew(buf);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv),*st=ZStrNew(buf);
|
||||
InStr("\"%%s\",%d;Free(%d);",st,st);
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U0 XTalkStr(CTask *task,U8 *fmt,...)
|
||||
U0 XTalkStr(CTask *task,U8 *format,...)
|
||||
{//Send InFile code to other task.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
TaskText(task,NULL,buf,0);
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U0 XTalkStrWait(CTask *task,U8 *fmt,...)
|
||||
U0 XTalkStrWait(CTask *task,U8 *format,...)
|
||||
{//Send InFile code to other task and wait for it to idle.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
TaskText(task,NULL,buf,0);
|
||||
Free(buf);
|
||||
TaskWait(task);
|
||||
|
@ -1,34 +1,34 @@
|
||||
//This is run in a $LK,"#exe",A="FF:::/Kernel/Kernel.PRJ,KCfg"${}.
|
||||
//This is run in a $LK,"#exe",A="FF:::/Kernel/Kernel.PRJ,KConfig"${}.
|
||||
|
||||
U8 *kernel_cfg_options="MemInit\0HeapInit\0VarInit\0StaffMode\0"
|
||||
U8 *kernel_config_options="MemInit\0HeapInit\0VarInit\0StaffMode\0"
|
||||
"HomeDir\0NoMP\0TextMode\0DontProbe\0MountIDEAuto\0DebugDistro\0Help\0";
|
||||
|
||||
#define CFG_MEM_INIT 0
|
||||
#define CFG_HEAP_INIT 1
|
||||
#define CFG_VAR_INIT 2
|
||||
#define CFG_STAFF_MODE 3
|
||||
#define CFG_HOME_DIR 4
|
||||
#define CFG_NO_MP 5
|
||||
#define CFG_TEXT_MODE 6
|
||||
#define CFG_DONT_PROBE 7
|
||||
#define CFG_MOUNT_IDE_AUTO 8
|
||||
#define CFG_DBG_DISTRO 9
|
||||
#define CFG_OPTIONS_NUM 10
|
||||
#define CONFIG_MEM_INIT 0
|
||||
#define CONFIG_HEAP_INIT 1
|
||||
#define CONFIG_VAR_INIT 2
|
||||
#define CONFIG_STAFF_MODE 3
|
||||
#define CONFIG_HOME_DIR 4
|
||||
#define CONFIG_NO_MP 5
|
||||
#define CONFIG_TEXT_MODE 6
|
||||
#define CONFIG_DONT_PROBE 7
|
||||
#define CONFIG_MOUNT_IDE_AUTO 8
|
||||
#define CONFIG_DBG_DISTRO 9
|
||||
#define CONFIG_OPTIONS_NUM 10
|
||||
|
||||
#define CFG_HELP 10
|
||||
#define CONFIG_HELP 10
|
||||
|
||||
class CKCfg
|
||||
class CKConfig
|
||||
{
|
||||
U8 *disk_cache_size_exp;
|
||||
CDoc *add_dev;
|
||||
U8 *dbg_distro_file,*dbg_distro_start;
|
||||
U8 *home_dir;
|
||||
Bool opts[CFG_OPTIONS_NUM];
|
||||
Bool opts[CONFIG_OPTIONS_NUM];
|
||||
U8 mem_init_val,heap_init_val,var_init_val,
|
||||
boot_drive_let,mount_ide_auto_hd_let,mount_ide_auto_cd_let;
|
||||
};
|
||||
|
||||
CDoc *KCfgAddDev(CKCfg *c)
|
||||
CDoc *KConfigAddDev(CKConfig *c)
|
||||
{
|
||||
I64 ch;
|
||||
CDoc *doc=DocNew;
|
||||
@ -47,22 +47,22 @@ CDoc *KCfgAddDev(CKCfg *c)
|
||||
return doc;
|
||||
}
|
||||
|
||||
U0 KCfgOptions(CKCfg *c)
|
||||
U0 KConfigOptions(CKConfig *c)
|
||||
{
|
||||
I64 i;
|
||||
U8 *st=NULL,*st2,*st3;
|
||||
Bool state;
|
||||
do {
|
||||
Free(st);
|
||||
for (i=0;i<CFG_OPTIONS_NUM;i++)
|
||||
if (i==CFG_HOME_DIR)
|
||||
"$$PURPLE$$%13tz$$FG$$:\"%s\"\n",i,kernel_cfg_options,c->home_dir;
|
||||
for (i=0;i<CONFIG_OPTIONS_NUM;i++)
|
||||
if (i==CONFIG_HOME_DIR)
|
||||
"$$PURPLE$$%13tz$$FG$$:\"%s\"\n",i,kernel_config_options,c->home_dir;
|
||||
else
|
||||
"$$PURPLE$$%13tz$$FG$$:%Z\n",i,kernel_cfg_options,c->opts[i],"ST_OFF_ON";
|
||||
"$$PURPLE$$%13tz$$FG$$:%Z\n",i,kernel_config_options,c->opts[i],"ST_OFF_ON";
|
||||
"\nType '$$PURPLE$$Help$$FG$$' for help.\n";
|
||||
st=GetStr("Option ($$PURPLE$$<ENTER>$$FG$$ when done):","");
|
||||
i=ListMatch(st,kernel_cfg_options,LMF_IGNORE_CASE);
|
||||
if (i==CFG_HELP)
|
||||
i=ListMatch(st,kernel_config_options,LMF_IGNORE_CASE);
|
||||
if (i==CONFIG_HELP)
|
||||
"\n"
|
||||
"$$PURPLE$$MemInit$$FG$$ Initializes memory above 0x100000 "
|
||||
"to a val at boot.\n"
|
||||
@ -76,22 +76,22 @@ U0 KCfgOptions(CKCfg *c)
|
||||
"$$PURPLE$$DebugDistro$$FG$$ Include RAM Drive in Kernel.BIN.\n"
|
||||
"\n";
|
||||
else
|
||||
if (0<=i<CFG_OPTIONS_NUM) {
|
||||
if (0<=i<CONFIG_OPTIONS_NUM) {
|
||||
state=c->opts[i]=!c->opts[i];
|
||||
switch (i) {
|
||||
case CFG_MEM_INIT:
|
||||
case CONFIG_MEM_INIT:
|
||||
if (state)
|
||||
c->mem_init_val=GetI64("Val (0-255):",255,0,255);
|
||||
break;
|
||||
case CFG_HEAP_INIT:
|
||||
case CONFIG_HEAP_INIT:
|
||||
if (state)
|
||||
c->heap_init_val=GetI64("Val (0-255):",255,0,255);
|
||||
break;
|
||||
case CFG_VAR_INIT:
|
||||
case CONFIG_VAR_INIT:
|
||||
if (state)
|
||||
c->var_init_val=GetI64("Val (0-255):",255,0,255);
|
||||
break;
|
||||
case CFG_HOME_DIR:
|
||||
case CONFIG_HOME_DIR:
|
||||
st2=GetStr("Home Dir(\"%s\"):",c->home_dir);
|
||||
if (!*st2)
|
||||
st2=StrNew("::/Home");
|
||||
@ -107,7 +107,7 @@ U0 KCfgOptions(CKCfg *c)
|
||||
else
|
||||
c->opts[i]=FALSE;
|
||||
break;
|
||||
case CFG_MOUNT_IDE_AUTO:
|
||||
case CONFIG_MOUNT_IDE_AUTO:
|
||||
if (state) {
|
||||
"First HD Drive Let:";
|
||||
c->mount_ide_auto_hd_let=Letter2Letter(GetChar);
|
||||
@ -133,7 +133,7 @@ U0 KCfgOptions(CKCfg *c)
|
||||
c->mount_ide_auto_cd_let=0;
|
||||
}
|
||||
break;
|
||||
case CFG_DBG_DISTRO:
|
||||
case CONFIG_DBG_DISTRO:
|
||||
Free(c->dbg_distro_file);
|
||||
c->dbg_distro_file=0;
|
||||
c->dbg_distro_start=0;
|
||||
@ -148,22 +148,22 @@ U0 KCfgOptions(CKCfg *c)
|
||||
Free(st);
|
||||
}
|
||||
|
||||
CKCfg *KCfgNew()
|
||||
CKConfig *KConfigNew()
|
||||
{
|
||||
CKCfg *c=CAlloc(sizeof(CKCfg));
|
||||
CKConfig *c=CAlloc(sizeof(CKConfig));
|
||||
|
||||
c->add_dev=KCfgAddDev(c);
|
||||
c->add_dev=KConfigAddDev(c);
|
||||
c->home_dir=StrNew("::/Home");
|
||||
c->disk_cache_size_exp=GetStr(
|
||||
"Disk Cache Size in Bytes,\n"
|
||||
"gets rounded-up funny,\n"
|
||||
"($$PURPLE$$<ENTER>$$FG$$ will use default.):",
|
||||
"Scale2Mem(0x80000,0x8000000)");
|
||||
KCfgOptions(c);
|
||||
KConfigOptions(c);
|
||||
return c;
|
||||
}
|
||||
|
||||
U0 KCfgDel(CKCfg *c)
|
||||
U0 KConfigDel(CKConfig *c)
|
||||
{
|
||||
DocDel(c->add_dev);
|
||||
Free(c->dbg_distro_file);
|
@ -214,10 +214,10 @@ U0 Da(U8 **addr,I64 count=0x10)
|
||||
}
|
||||
}
|
||||
|
||||
U0 RawPrint(I64 mS=100,U8 *fmt,...)
|
||||
U0 RawPrint(I64 mS=100,U8 *format,...)
|
||||
{//Print using $LK,"Raw",A="MN:Raw"$ scrn output for a length of time.
|
||||
//$BK,1$Your heap must be good.$BK,0$
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
Bool old_raw,old_input_filter;
|
||||
PUSHFD
|
||||
CLI
|
||||
@ -552,7 +552,7 @@ U0 Debug2()
|
||||
old_getstr2=fp_getstr2;
|
||||
fp_getstr2=&SysGetStr2;
|
||||
old_single=SingleUser(OFF);
|
||||
while (!ms_hard.install_attempts)
|
||||
while (!mouse_hard.install_attempts)
|
||||
Yield;
|
||||
SingleUser(old_single);
|
||||
UserTaskCont;
|
||||
|
@ -9,8 +9,8 @@ import U0 ClassRep(U8 *_d,U8 *class_name=lastclass,
|
||||
import U8 *DocSave(CDoc *doc,I64 *_size=NULL);
|
||||
import Bool DocUnlock(CDoc *doc);
|
||||
import Bool Ed(U8 *link_st,I64 edf_dof_flags=0);
|
||||
extern U0 ZenithErr(U8 *fmt,...);
|
||||
extern U0 ZenithLog(U8 *fmt,...);
|
||||
extern U0 ZenithErr(U8 *format,...);
|
||||
extern U0 ZenithLog(U8 *format,...);
|
||||
extern I64 BIOSTotalMem();
|
||||
extern I64 BlkDevAdd(CBlkDev *bd,I64 prt_num=I64_MIN,
|
||||
Bool whole_drive,Bool make_free);
|
||||
@ -22,7 +22,7 @@ extern U0 BlkDevsRelease();
|
||||
extern Bool BlkRead(CDrive *drive,U8 *buf, I64 blk, I64 count);
|
||||
extern Bool BlkWrite(CDrive *drive,U8 *buf, I64 blk, I64 count);
|
||||
extern U8 *Caller(I64 num=1);
|
||||
extern U8 *CatPrint(U8 *_dst,U8 *fmt,...);
|
||||
extern U8 *CatPrint(U8 *_dst,U8 *format,...);
|
||||
extern Bool Cd(U8 *dirname=NULL,Bool make_dirs=FALSE);
|
||||
extern U0 DebugHelp();
|
||||
extern U8 *Define(U8 *dname);
|
||||
@ -75,12 +75,12 @@ extern I64 Letter2BlkDevType(U8 drv_let);
|
||||
extern CDrive *Letter2Drive(U8 drv_let=0,Bool except=TRUE);
|
||||
extern U8 Letter2Letter(U8 drv_let=0);
|
||||
extern U0 MPInt(U8 num,I64 cpu_num=1);
|
||||
extern U8 *MStrPrint(U8 *fmt,...);
|
||||
extern U0 MsHardSet(I64 x,I64 y,I64 z,I64 l,I64 r);
|
||||
extern U8 *MStrPrint(U8 *format,...);
|
||||
extern U0 MouseHardSet(I64 x,I64 y,I64 z,I64 l,I64 r);
|
||||
extern U0 Message(I64 message_code,I64 arg1,I64 arg2,I64 flags=0);
|
||||
extern U0 Panic(U8 *message=NULL,I64 message_num=0,Bool panic=TRUE);
|
||||
extern I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL);
|
||||
extern U0 Print(U8 *fmt,...);
|
||||
extern U0 Print(U8 *format,...);
|
||||
extern U0 PutChars(U64 ch);
|
||||
extern U0 PutS(U8 *st); //Use $LK,"Print",A="MN:Print"$()
|
||||
extern I64 RedSeaAllocClus(CDrive *drive,I64 count);
|
||||
@ -88,14 +88,14 @@ 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);
|
||||
extern U0 RedSeaFmt(U8 drv_let,Bool quick=TRUE);
|
||||
extern U0 RedSeaFormat(U8 drv_let,Bool quick=TRUE);
|
||||
extern U0 RedSeaFreeFreeList(CDrive *drive);
|
||||
extern U0 RedSeaInit(CDrive *drive);
|
||||
extern Bool RedSeaValidate(U8 drv_let);
|
||||
extern CTask *SpawnQueue(U0 (*fp_addr)(U8 *data),U8 *data=NULL,
|
||||
U8 *task_name=NULL,I64 target_cpu,CTask *parent=NULL, //NULL means zenith
|
||||
I64 stack_size=0,I64 flags=1<<JOBf_ADD_TO_QUE);
|
||||
extern U8 *StrPrint(U8 *dst,U8 *fmt,...);
|
||||
extern U8 *StrPrint(U8 *dst,U8 *format,...);
|
||||
extern U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags);
|
||||
extern Bool Suspend(CTask *task=NULL,Bool state=TRUE);
|
||||
extern CJob *TaskMessage(CTask *_srv,CTask *master,
|
||||
@ -103,7 +103,7 @@ extern CJob *TaskMessage(CTask *_srv,CTask *master,
|
||||
extern U0 TaskResetAwaitingMessage(CTask *task=NULL);
|
||||
extern Bool TaskValidate(CTask *task);
|
||||
extern U0 TaskWait(CTask *task=NULL,Bool cmd_line_prompt=FALSE);
|
||||
extern CTask *User(U8 *fmt=NULL,...);
|
||||
extern CTask *User(U8 *format=NULL,...);
|
||||
extern U0 UserTaskCont();
|
||||
extern U0 XTalk(CTask *task,U8 *fmt,...);
|
||||
extern U0 XTalk(CTask *task,U8 *format,...);
|
||||
extern U0 throw(I64 ch=0,Bool no_log=FALSE);
|
||||
|
@ -21,11 +21,11 @@ CBlkDevGlobals blkdev;
|
||||
CCountsGlobals counts={1,0,2676302000,2676302,2676302000,0,0,0,FALSE};
|
||||
CDebugGlobals dbg;
|
||||
CDevGlobals dev;
|
||||
CGridGlobals ms_grid; //See $LK,"::/Demo/Graphics/Grid.HC"$.
|
||||
CMsStateGlobals ms,ms_last;
|
||||
CGridGlobals mouse_grid; //See $LK,"::/Demo/Graphics/Grid.HC"$.
|
||||
CMouseStateGlobals mouse,mouse_last;
|
||||
CKbdStateGlobals kbd;
|
||||
CKeyDevGlobals keydev;
|
||||
CMsHardStateGlobals ms_hard,ms_hard_last;
|
||||
CMouseHardStateGlobals mouse_hard,mouse_hard_last;
|
||||
CScreenCastGlobals screencast;
|
||||
CTextGlobals text;
|
||||
|
||||
|
@ -14,14 +14,14 @@ U0 SysGlobalsInit()
|
||||
blkdev.tmp_filename =ZStrNew("~/Tmp.DD");
|
||||
blkdev.dvd_boot_is_good=TRUE;
|
||||
#exe {
|
||||
if (!kernel_cfg->mount_ide_auto_hd_let)
|
||||
kernel_cfg->mount_ide_auto_hd_let='C';
|
||||
if (!kernel_cfg->mount_ide_auto_cd_let)
|
||||
kernel_cfg->mount_ide_auto_cd_let='T';
|
||||
if (!kernel_config->mount_ide_auto_hd_let)
|
||||
kernel_config->mount_ide_auto_hd_let='C';
|
||||
if (!kernel_config->mount_ide_auto_cd_let)
|
||||
kernel_config->mount_ide_auto_cd_let='T';
|
||||
StreamPrint("blkdev.first_hd_drive_let=%d;",
|
||||
kernel_cfg->mount_ide_auto_hd_let);
|
||||
kernel_config->mount_ide_auto_hd_let);
|
||||
StreamPrint("blkdev.first_dvd_drive_let=%d;",
|
||||
kernel_cfg->mount_ide_auto_cd_let);
|
||||
kernel_config->mount_ide_auto_cd_let);
|
||||
}
|
||||
|
||||
DebugMode(ON);
|
||||
@ -38,9 +38,9 @@ U0 SysGlobalsInit()
|
||||
KeyDevInit;
|
||||
|
||||
#exe {
|
||||
StreamPrint("blkdev.boot_drive_let='%C';",kernel_cfg->boot_drive_let);
|
||||
StreamPrint("blkdev.boot_drive_let='%C';",kernel_config->boot_drive_let);
|
||||
StreamPrint("#exe{Option(OPTf_WARN_PAREN,OFF);}");
|
||||
StreamPrint("DiskCacheInit(%s);",kernel_cfg->disk_cache_size_exp);
|
||||
StreamPrint("DiskCacheInit(%s);",kernel_config->disk_cache_size_exp);
|
||||
StreamPrint("#exe{Option(OPTf_WARN_PAREN,ON);}");
|
||||
};
|
||||
|
||||
@ -97,8 +97,8 @@ U0 TimersInit()
|
||||
|
||||
//High Precision Event Timer
|
||||
if (PCIReadU16(0,31,0,0)==0x8086) {//Intel?
|
||||
//D31 F0, cfg 0xF0=RCBA of PCI-LPC Bridge
|
||||
_d=PCIReadU32(0,31,0,0xF0)(U8 *)&~0x3FFF+0x3404; //HPET cfg
|
||||
//D31 F0, config 0xF0=RCBA of PCI-LPC Bridge
|
||||
_d=PCIReadU32(0,31,0,0xF0)(U8 *)&~0x3FFF+0x3404; //HPET config
|
||||
//7 enable
|
||||
//1:0 HPET is at 0xFED00000,0xFED01000, 0xFED02000 or 0xFED03000.
|
||||
*_d=*_d&3|0x80;
|
||||
@ -178,7 +178,7 @@ U0 KMain()
|
||||
#exe {
|
||||
StreamPrint("HomeSet(\"%s\");\n"
|
||||
"blkdev.ins_base0=%d;blkdev.ins_base1=%d;blkdev.ins_unit =%d;\n",
|
||||
kernel_cfg->home_dir,
|
||||
kernel_config->home_dir,
|
||||
blkdev.ins_base0,blkdev.ins_base1,blkdev.ins_unit);
|
||||
}
|
||||
Gs->idle_task->cur_dv=blkdev.let_to_drive[*blkdev.home_dir-'A'];
|
||||
@ -194,16 +194,16 @@ U0 KMain()
|
||||
LBts(&sys_run_level,RLf_BLKDEV);
|
||||
|
||||
#exe {
|
||||
if (!kernel_cfg->opts[CFG_NO_MP])
|
||||
if (!kernel_config->opts[CONFIG_NO_MP])
|
||||
StreamPrint("\"MultiCore Start\\n\\n\";"
|
||||
"Core0StartMP;"
|
||||
"LBts(&sys_run_level,RLf_MP);");
|
||||
};
|
||||
|
||||
KbdMsInit;
|
||||
MsInit;
|
||||
KbdMouseInit;
|
||||
MouseInit;
|
||||
KbdInit;
|
||||
Spawn(&MsHardDriverInstall);
|
||||
Spawn(&MouseHardDriverInstall);
|
||||
|
||||
"Loading Compiler\n";
|
||||
Cd("/Compiler");
|
||||
@ -229,10 +229,10 @@ U0 KMain()
|
||||
asm { ALIGN 16,OC_NOP
|
||||
SYS_KERNEL_END::
|
||||
#exe {
|
||||
if (kernel_cfg->opts[CFG_DBG_DISTRO])
|
||||
if (kernel_config->opts[CONFIG_DBG_DISTRO])
|
||||
StreamPrint("DU8 0x%X-(SYS_KERNEL_END-SYS_KERNEL+"
|
||||
"BOOT_RAM_BASE+sizeof(CBinFile)) DUP (0);"
|
||||
"BINFILE \"%s\";",kernel_cfg->dbg_distro_start,
|
||||
kernel_cfg->dbg_distro_file);
|
||||
"BINFILE \"%s\";",kernel_config->dbg_distro_start,
|
||||
kernel_config->dbg_distro_file);
|
||||
};
|
||||
}
|
||||
|
@ -203,14 +203,14 @@ U0 Sound(I8 ona=0)
|
||||
}
|
||||
}
|
||||
|
||||
Bool ScreenCast(Bool val=ON,Bool just_audio=FALSE,U8 *print_fmt="B:/Tmp/%X.GR")
|
||||
Bool ScreenCast(Bool val=ON,Bool just_audio=FALSE,U8 *print_format="B:/Tmp/%X.GR")
|
||||
{//WinMgr saves GR files to a dir.
|
||||
Bool old_val;
|
||||
screencast.just_audio=just_audio;
|
||||
if (val) {
|
||||
if (!(old_val=LBtr(&screencast.record,0))) {
|
||||
Free(screencast.print_fmt);
|
||||
screencast.print_fmt=ZStrNew(print_fmt);
|
||||
Free(screencast.print_format);
|
||||
screencast.print_format=ZStrNew(print_format);
|
||||
screencast.t0_now=Now;
|
||||
screencast.sound_head.tS=screencast.t0_tS=tS;
|
||||
screencast.sound_head.ona=screencast.ona;
|
||||
|
@ -80,7 +80,7 @@ GET_RIP: POP BX
|
||||
MOV AX,0x4F02
|
||||
MOV BX,0x12 //640x480 16 color
|
||||
#exe {
|
||||
if (!kernel_cfg->opts[CFG_TEXT_MODE])
|
||||
if (!kernel_config->opts[CONFIG_TEXT_MODE])
|
||||
StreamPrint("INT 0x10"); //Enable VGA
|
||||
};
|
||||
CMP AX,0x004F
|
||||
|
@ -23,12 +23,12 @@ MEM_PML4:: DU64 0;
|
||||
"SYS_VAR_INIT_FLAG:: DU8 %d;"
|
||||
"SYS_VAR_INIT_VAL:: DU8 %d;"
|
||||
"SYS_STAFF_MODE_FLAG:: DU8 %d;",
|
||||
kernel_cfg->opts[CFG_MEM_INIT], kernel_cfg->mem_init_val,
|
||||
kernel_cfg->opts[CFG_HEAP_INIT],kernel_cfg->heap_init_val,
|
||||
kernel_cfg->opts[CFG_VAR_INIT], kernel_cfg->var_init_val,
|
||||
kernel_cfg->opts[CFG_STAFF_MODE]);
|
||||
kernel_config->opts[CONFIG_MEM_INIT], kernel_config->mem_init_val,
|
||||
kernel_config->opts[CONFIG_HEAP_INIT],kernel_config->heap_init_val,
|
||||
kernel_config->opts[CONFIG_VAR_INIT], kernel_config->var_init_val,
|
||||
kernel_config->opts[CONFIG_STAFF_MODE]);
|
||||
};
|
||||
SYS_HEAP_DBG_FLAG:: DU8 _CFG_HEAP_DBG;
|
||||
SYS_HEAP_DBG_FLAG:: DU8 _CONFIG_HEAP_DBG;
|
||||
|
||||
ALIGN 8,0
|
||||
SYS_CTRL_ALT_FLAGS:: DU64 0;
|
||||
|
@ -421,13 +421,13 @@ U0 UserCmdLine(I64 dummy=0)
|
||||
UserTaskCont;
|
||||
}
|
||||
|
||||
CTask *User(U8 *fmt=NULL,...)
|
||||
CTask *User(U8 *format=NULL,...)
|
||||
{//Create user term task.
|
||||
U8 *st;
|
||||
CTask *task=Spawn(&UserCmdLine,,"Terminal");
|
||||
TaskWait(task);
|
||||
if (fmt) {
|
||||
st=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
if (format) {
|
||||
st=StrPrintJoin(NULL,format,argc,argv);
|
||||
XTalk(task,st);
|
||||
Free(st);
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -5,9 +5,9 @@
|
||||
Cd(__DIR__);;
|
||||
Option(OPTf_WARN_PAREN,ON);
|
||||
Option(OPTf_WARN_DUP_TYPES,ON);
|
||||
#include "KCfg"
|
||||
CKCfg *kernel_cfg;
|
||||
kernel_cfg=KCfgNew;
|
||||
#include "KConfig"
|
||||
CKConfig *kernel_config;
|
||||
kernel_config=KConfigNew;
|
||||
};
|
||||
|
||||
#include "KernelA.HH"
|
||||
@ -28,7 +28,7 @@
|
||||
#include "KGlobals"
|
||||
#include "KMathB"
|
||||
#include "Sched"
|
||||
#include "Mem/MakeMem"
|
||||
#include "Mem/MakeMem"
|
||||
#include "FontStd"
|
||||
#include "FontCyrillic"
|
||||
#include "StrB"
|
||||
@ -58,4 +58,4 @@
|
||||
#include "FunSeg"
|
||||
#include "KMain"
|
||||
|
||||
#exe {KCfgDel(kernel_cfg);};
|
||||
#exe {KConfigDel(kernel_config);};
|
||||
|
@ -1211,7 +1211,7 @@ public class CDocEntry:CDocEntryBase
|
||||
*aux_str,
|
||||
*bin_ptr_link,
|
||||
*html_link,
|
||||
*my_fmt_data;
|
||||
*my_format_data;
|
||||
I64 hex_ed_width;
|
||||
I32 scroll_len,
|
||||
len, //$LK,"DOCE_LEN_DEFAULT",A="MN:DOCE_LEN_DEFAULT"$
|
||||
@ -2770,9 +2770,9 @@ public class CFile //See $LK,"::/Demo/Disk/DataBase.HC"$.
|
||||
};
|
||||
|
||||
#help_index "Memory/Heap"
|
||||
#define _CFG_HEAP_DBG FALSE
|
||||
#define _CONFIG_HEAP_DBG FALSE
|
||||
|
||||
#if _CFG_HEAP_DBG
|
||||
#if _CONFIG_HEAP_DBG
|
||||
class CMemUnused
|
||||
{
|
||||
CHeapCtrl *hc;
|
||||
@ -2971,12 +2971,12 @@ public class CKbdStateGlobals
|
||||
//BitTest, $LK,"Bt",A="MN:Bt"$(), with an unmerged scan code.
|
||||
down_bitmap2[8];
|
||||
|
||||
Bool reset, //Private: Reset KbdMs
|
||||
Bool reset, //Private: Reset KbdMouse
|
||||
irqs_working; //Private
|
||||
};
|
||||
|
||||
#help_index "Mouse"
|
||||
public class CMsHardStateGlobals
|
||||
public class CMouseHardStateGlobals
|
||||
{
|
||||
CD3I64 pos, //Position in pixels
|
||||
prescale;
|
||||
@ -2995,7 +2995,7 @@ public class CMsHardStateGlobals
|
||||
irqs_working; //Private
|
||||
};
|
||||
|
||||
public class CMsStateGlobals
|
||||
public class CMouseStateGlobals
|
||||
{
|
||||
CD3I64 pos, //Position in pixels
|
||||
pos_text, //Position in text rows,cols
|
||||
@ -3059,7 +3059,7 @@ public class CViewAngles
|
||||
{
|
||||
I64 sx,sy,sz;
|
||||
F64 ax,ay,az;
|
||||
CColorROPU32 cx,cy,cz,cbd,cbg,cfg;
|
||||
CColorROPU32 cx,cy,cz,cbd,cbg,config;
|
||||
};
|
||||
|
||||
public class CCtrl
|
||||
@ -3773,13 +3773,13 @@ class CKeyDevGlobals
|
||||
#help_index "Sound"
|
||||
#help_index "ScreenCast;Sound/AU Files"
|
||||
public class CAUData
|
||||
{//Fmt of AU files
|
||||
{//Format of AU files
|
||||
CDate cdt;
|
||||
I8 ona;
|
||||
};
|
||||
|
||||
class CSoundData
|
||||
{//Fmt recorded in mem
|
||||
{//Format recorded in mem
|
||||
CSoundData *next,*last;
|
||||
F64 tS;
|
||||
I8 ona;
|
||||
@ -3790,7 +3790,7 @@ public class CScreenCastGlobals
|
||||
CSoundData sound_head;
|
||||
CDate t0_now;
|
||||
F64 t0_tS;
|
||||
U8 *print_fmt;
|
||||
U8 *print_format;
|
||||
CDC *dc,*dc2_alias;
|
||||
Bool record,just_audio;
|
||||
I8 ona;
|
||||
@ -3843,7 +3843,7 @@ public class CDebugGlobals
|
||||
#define BOOT_SRC_DVD 4
|
||||
|
||||
// $LK,"In",A="MN:In"$("") StdIn for call to $LK,"BootHDIns",A="MN:BootHDIns"$().
|
||||
#define STD_DISTRO_DVD_CFG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
|
||||
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
|
||||
|
||||
#help_index "Registry"
|
||||
//Registry sys_message_flags. $LK,"RegOneTimePopUp",A="MN:RegOneTimePopUp"$()
|
||||
|
@ -46,7 +46,7 @@ public extern U8 ScanCode2Char(I64 sc);
|
||||
public extern U8 *ScanCode2KeyName(I64 sc);
|
||||
public extern F64 Str2F64(U8 *src,U8 **_end_ptr=NULL);
|
||||
public extern I64 Str2I64(U8 *st,I64 radix=10,U8 **_end_ptr=NULL);
|
||||
public extern U8 *StrScan(U8 *src,U8 *fmt,...);
|
||||
public extern U8 *StrScan(U8 *src,U8 *format,...);
|
||||
|
||||
#help_index "Char/Conversion;Time/Date/CDate;Date/CDate"
|
||||
public extern CDate Str2Date(U8 *src);
|
||||
@ -60,7 +60,7 @@ public extern I64 ListMatch(U8 *needle, U8 *haystack_list,I64 flags=0);
|
||||
public extern U8 *ListSub(I64 sub, U8 *list);
|
||||
|
||||
#help_index "Char/Operations"
|
||||
public extern U8 *MStrPrint(U8 *fmt,...);
|
||||
public extern U8 *MStrPrint(U8 *format,...);
|
||||
public extern U8 *MStrUtil(U8 *src,I64 flags,F64 indent_scale_factor=0);
|
||||
public extern U8 *ScaleIndent(U8 *src,F64 indent_scale_factor);
|
||||
public extern I64 Spaces2Tabs(U8 *dst,U8 *src);
|
||||
@ -77,14 +77,14 @@ public _extern _STRMATCH U8 *StrMatch(U8 *needle,U8 *haystack_str);
|
||||
public _extern _STRNCMP I64 StrNCmp(U8 *st1,U8 *st2,I64 n);
|
||||
public _extern _STRNICMP I64 StrNICmp(U8 *st1,U8 *st2,I64 n);
|
||||
public extern I64 StrOcc(U8 *src, U8 ch);
|
||||
public extern U8 *StrPrint(U8 *dst,U8 *fmt,...);
|
||||
public extern U8 *StrPrintJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv);
|
||||
public extern U8 *StrPrint(U8 *dst,U8 *format,...);
|
||||
public extern U8 *StrPrintJoin(U8 *dst,U8 *format,I64 argc,I64 *argv);
|
||||
public extern U8 *StrUtil(U8 *_src,I64 flags);
|
||||
public extern U8 *Tabs2Spaces(U8 *src);
|
||||
public extern Bool WildMatch(U8 *test_str,U8 *wild_str);
|
||||
|
||||
#help_index "Char/Operations;Memory"
|
||||
public extern U8 *CatPrint(U8 *dst,U8 *fmt,...);
|
||||
public extern U8 *CatPrint(U8 *dst,U8 *format,...);
|
||||
|
||||
#help_index "Char/Operations;Memory/Zenith Heap"
|
||||
public extern U8 *ZStrNew(U8 *buf);
|
||||
@ -95,9 +95,9 @@ public extern U8 *StrNew(U8 *buf,CTask *mem_task=NULL);
|
||||
#help_index "Char/Output;StdOut"
|
||||
public extern U0 GetOutOfDollar();
|
||||
public extern Bool IsSilent();
|
||||
public extern U0 Print(U8 *fmt,...);
|
||||
public extern U0 PrintErr(U8 *fmt,...);
|
||||
public extern U0 PrintWarn(U8 *fmt,...);
|
||||
public extern U0 Print(U8 *format,...);
|
||||
public extern U0 PrintErr(U8 *format,...);
|
||||
public extern U0 PrintWarn(U8 *format,...);
|
||||
public extern U0 PutChars(U64 ch);
|
||||
extern U0 PutHex(I64 num,I64 width);
|
||||
public extern U0 PutKey(I64 ch=0,I64 sc=0);
|
||||
@ -187,10 +187,10 @@ public extern Bool EdLite(U8 *filename,I64 num=1,I64 edf_dof_flags=0);
|
||||
extern Bool EdLiteFileLine(U8 *fl_file_line,I64 edf_dof_flags=0);
|
||||
public extern Bool Fix(I64 edf_dof_flags=0);
|
||||
public extern U0 FixSet(U8 *filename,I64 line);
|
||||
public extern U0 G(U8 *ms=INVALID_PTR,CTask *task=NULL);
|
||||
public extern U0 G2(U8 *ms=INVALID_PTR,CTask *task=NULL);
|
||||
public extern U0 G(U8 *mouse=INVALID_PTR,CTask *task=NULL);
|
||||
public extern U0 G2(U8 *mouse=INVALID_PTR,CTask *task=NULL);
|
||||
public extern Bool IsDebugMode();
|
||||
public extern U0 S(U8 *ms=INVALID_PTR,CTask *task=NULL);
|
||||
public extern U0 S(U8 *mouse=INVALID_PTR,CTask *task=NULL);
|
||||
|
||||
#help_index "Debugging/Debugger;DolDoc/Cmd Line (Typically);"\
|
||||
"Cmd Line (Typically);Help System"
|
||||
@ -221,7 +221,7 @@ public extern Bool Raw(Bool val);
|
||||
public extern U0 RawD(I64 mS=100,U8 *addr,I64 count=0x80);
|
||||
public extern U0 RawDm(I64 mS=100,U8 *addr,I64 count=0x80);
|
||||
extern U0 RawDr(CTask *task=NULL);
|
||||
public extern U0 RawPrint(I64 mS=100,U8 *fmt,...);
|
||||
public extern U0 RawPrint(I64 mS=100,U8 *format,...);
|
||||
public extern U0 RawPutChar(I64 ch);
|
||||
public extern U0 VGAFlush();
|
||||
|
||||
@ -450,15 +450,15 @@ extern CATARep *ATARepFind(CATARep *haystack_head,I64 needle_num);
|
||||
public extern Bool DriveEnable(U8 drv_let,Bool val);
|
||||
|
||||
#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);"
|
||||
public extern U0 Fmt(U8 drv_let,Bool quick=TRUE,
|
||||
public extern U0 Format(U8 drv_let,Bool quick=TRUE,
|
||||
Bool confirm=TRUE,I64 type=FSt_FAT32);
|
||||
|
||||
#help_index "Install;Memory/BlkPool"
|
||||
public extern I64 Scale2Mem(I64 min,I64 max,I64 limit=2*1024*1024*1024);
|
||||
|
||||
#help_index "Job/Exe;Task/Job/Exe"
|
||||
public extern U0 ZenithErr(U8 *fmt,...);
|
||||
public extern U0 ZenithLog(U8 *fmt,...);
|
||||
public extern U0 ZenithErr(U8 *format,...);
|
||||
public extern U0 ZenithLog(U8 *format,...);
|
||||
public extern I64 ExeCmdLine(CCompCtrl *cc);
|
||||
public extern U0 JobDel(CJob *tmpc);
|
||||
public extern I64 JobsHandler(I64 run_flags,CTask *task=NULL);
|
||||
@ -469,9 +469,9 @@ public extern U0 TaskResetAwaitingMessage(CTask *task=NULL);
|
||||
public extern U0 UserTaskCont();
|
||||
|
||||
#help_index "Job/Exe;Task/Job/Exe;Compiler"
|
||||
public extern I64 Zenith(U8 *fmt,...);
|
||||
public extern I64 Zenith(U8 *format,...);
|
||||
public extern I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL);
|
||||
public extern I64 PopUpPrint(U8 *fmt,...);
|
||||
public extern I64 PopUpPrint(U8 *format,...);
|
||||
|
||||
#help_index "Job/Exe;Task/Job/Exe;MultiCore"
|
||||
public extern I64 JobResGet(CJob *rqst=NULL);
|
||||
@ -481,13 +481,13 @@ public extern Bool JobResScan(CJob *rqst=NULL,I64 *_res=NULL);
|
||||
public extern CJob *TaskText(CTask *srv,CTask *master,U8 *data,I64 flags);
|
||||
|
||||
#help_index "Job/Text & Messages;Task/Job/Text & Messages;InFile;StdIn/InFile"
|
||||
public extern U0 In(U8 *fmt,...);
|
||||
public extern U0 In(U8 *format,...);
|
||||
public extern U0 InFile(U8 *filename);
|
||||
public extern U0 InStr(U8 *fmt,...);
|
||||
public extern U0 XTalk(CTask *task,U8 *fmt,...);
|
||||
public extern U0 XTalkStr(CTask *task,U8 *fmt,...);
|
||||
public extern U0 XTalkStrWait(CTask *task,U8 *fmt,...);
|
||||
public extern U0 XTalkWait(CTask *task,U8 *fmt,...);
|
||||
public extern U0 InStr(U8 *format,...);
|
||||
public extern U0 XTalk(CTask *task,U8 *format,...);
|
||||
public extern U0 XTalkStr(CTask *task,U8 *format,...);
|
||||
public extern U0 XTalkStrWait(CTask *task,U8 *format,...);
|
||||
public extern U0 XTalkWait(CTask *task,U8 *format,...);
|
||||
|
||||
#help_index "Job/Text & Messages;Task/Job/Text & Messages;Messages"
|
||||
public extern U0 Message(I64 message_code,I64 arg1,I64 arg2,I64 flags=0);
|
||||
@ -505,7 +505,7 @@ public extern CJob *TaskMessage(CTask *srv,CTask *master,
|
||||
#help_file "::/Doc/KeyDev"
|
||||
public extern U0 CtrlAltCBSet(U8 ch,U0 (*fp_handler)(I64 sc),
|
||||
U8 *no_shift_desc=NULL,U8 *shift_desc=NULL,Bool in_irq=FALSE);
|
||||
public extern U0 KeyDescSet(U8 *fmt,...);
|
||||
public extern U0 KeyDescSet(U8 *format,...);
|
||||
public extern CKeyDevEntry *KeyDevAdd(Bool (*fp_put_key)(I64 ch,I64 sc),
|
||||
Bool (*fp_puts)(U8 *st),I64 priority,Bool key_descs=FALSE);
|
||||
public extern U0 KeyDevRemove(CKeyDevEntry *tmpk);
|
||||
@ -523,12 +523,12 @@ public extern I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,
|
||||
public extern I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE);
|
||||
public extern U8 *GetStr(U8 *message=NULL,U8 *default=NULL,I64 flags=0);
|
||||
extern U0 KbdInit();
|
||||
public extern I64 KbdMsEvtTime();
|
||||
extern U0 KbdMsHandler(Bool poll_kbd,Bool poll_ms);
|
||||
extern U0 KbdMsInit();
|
||||
public extern I64 KbdMouseEvtTime();
|
||||
extern U0 KbdMouseHandler(Bool poll_kbd,Bool poll_mouse);
|
||||
extern U0 KbdMouseInit();
|
||||
extern I64 KbdMessagesQueue();
|
||||
public extern U0 KbdTypeMatic(U8 delay);
|
||||
extern Bool MsHardDriverInstall();
|
||||
extern Bool MouseHardDriverInstall();
|
||||
public extern I64 PressAKey();
|
||||
public extern I64 ScanChar();
|
||||
public extern Bool ScanKey(I64 *_ch=NULL,I64 *_scan_code=NULL,Bool echo=FALSE);
|
||||
@ -611,17 +611,17 @@ public extern U0 ProgressBarsReset(U8 *path=NULL);
|
||||
#help_index "Mouse"
|
||||
#help_file "::/Doc/Mouse"
|
||||
public extern U0 GridInit();
|
||||
public extern U0 MsSet(I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,
|
||||
public extern U0 MouseSet(I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,
|
||||
I64 l=I64_MAX,I64 r=I64_MAX);
|
||||
public extern CMsStateGlobals ms;
|
||||
public extern CGridGlobals ms_grid;
|
||||
public extern CMsHardStateGlobals ms_hard;
|
||||
extern CMsHardStateGlobals ms_hard_last;
|
||||
extern CMsStateGlobals ms_last;
|
||||
public extern CMouseStateGlobals mouse;
|
||||
public extern CGridGlobals mouse_grid;
|
||||
public extern CMouseHardStateGlobals mouse_hard;
|
||||
extern CMouseHardStateGlobals mouse_hard_last;
|
||||
extern CMouseStateGlobals mouse_last;
|
||||
|
||||
#help_index "Mouse/Ptr"
|
||||
extern U0 MsInit();
|
||||
extern U0 MsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r);
|
||||
extern U0 MouseInit();
|
||||
extern U0 MouseUpdate(I64 x,I64 y,I64 z,Bool l,Bool r);
|
||||
|
||||
#help_index "MultiCore"
|
||||
extern U0 Core0StartMP();
|
||||
@ -666,7 +666,7 @@ public extern U8 *IntEntrySet(I64 irq,
|
||||
|
||||
#help_index "ScreenCast;Cmd Line (Typically)"
|
||||
public extern Bool ScreenCast(Bool val=ON,Bool just_audio=FALSE,
|
||||
U8 *print_fmt="B:/Tmp/%X.GR")
|
||||
U8 *print_format="B:/Tmp/%X.GR")
|
||||
public extern CScreenCastGlobals screencast;
|
||||
|
||||
#help_index "Sound"
|
||||
@ -699,7 +699,7 @@ public extern U0 TaskQueueIns(CTask *task,CTask *pred=NULL);
|
||||
public extern U0 TaskQueueRemove(CTask *task);
|
||||
public extern Bool TaskValidate(CTask *task);
|
||||
public extern U0 TaskWait(CTask *task=NULL,Bool cmd_line_prompt=FALSE);
|
||||
public extern CTask *User(U8 *fmt=NULL,...);
|
||||
public extern CTask *User(U8 *format=NULL,...);
|
||||
public extern U0 UserCmdLine();
|
||||
public _extern _YIELD U0 Yield();
|
||||
public extern CTask *zenith_task;
|
||||
|
@ -53,9 +53,9 @@ U0 PutS(U8 *st)
|
||||
}
|
||||
}
|
||||
|
||||
U0 KeyDescSet(U8 *fmt,...)
|
||||
U0 KeyDescSet(U8 *format,...)
|
||||
{//Call this from key handler to report desc in $LK,"KeyMap",A="MN:KeyMap"$().
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
StrCpy(keydev.desc,buf);
|
||||
keydev.handler=Caller;
|
||||
Free(buf);
|
||||
|
@ -150,7 +150,7 @@ MALLOC_ALMOST_DONE:
|
||||
//RDX=HeapCtrl
|
||||
ADD U64 CHeapCtrl.used_u8s[RDX],RAX
|
||||
|
||||
#if _CFG_HEAP_DBG
|
||||
#if _CONFIG_HEAP_DBG
|
||||
//QueueInsert
|
||||
MOV RDI,U64 CHeapCtrl.last_um[RDX]
|
||||
MOV U64 CMemUsed.next[RDI],RSI
|
||||
@ -248,7 +248,7 @@ _FREE::
|
||||
@@15: MOV RSI,U64 SF_ARG1[RBP]
|
||||
TEST RSI,RSI
|
||||
|
||||
#if _CFG_HEAP_DBG
|
||||
#if _CONFIG_HEAP_DBG
|
||||
JZ I32 FREE_DONE
|
||||
#else
|
||||
JZ FREE_DONE
|
||||
@ -277,7 +277,7 @@ _FREE::
|
||||
BTS U32 CHeapCtrl.locked_flags[RDX],HClf_LOCKED
|
||||
PAUSE
|
||||
JC @@30
|
||||
#if _CFG_HEAP_DBG
|
||||
#if _CONFIG_HEAP_DBG
|
||||
//QueueRemove
|
||||
MOV RDX,U64 CMemUsed.next[RSI]
|
||||
MOV RDI,U64 CMemUsed.last[RSI]
|
||||
|
@ -62,7 +62,7 @@ U0 KbdLEDsSet(I64 sc)
|
||||
Fs->catch_except=TRUE;
|
||||
}
|
||||
|
||||
U0 KbdMsCmdAck(...)
|
||||
U0 KbdMouseCmdAck(...)
|
||||
{
|
||||
I64 i,ack,timeout;
|
||||
for (i=0;i<argc;i++) {
|
||||
@ -385,7 +385,7 @@ U0 KbdBuildSC(U8 raw_byte,Bool in_irq,U8 *_last_raw_byte,I64 *_last_sc)
|
||||
*_last_sc=sc;
|
||||
}
|
||||
|
||||
U0 KbdPktRead()
|
||||
U0 KbdPacketRead()
|
||||
{
|
||||
static U8 last_raw_byte=0;
|
||||
static I64 last_sc=0;
|
||||
@ -413,12 +413,12 @@ interrupt U0 IRQKbd()
|
||||
CLD
|
||||
OutU8(0x20,0x20);
|
||||
kbd.irqs_working=TRUE;
|
||||
if (ms_hard.install_in_progress) {
|
||||
if (mouse_hard.install_in_progress) {
|
||||
kbd.reset=TRUE;
|
||||
return;
|
||||
}
|
||||
keydev.ctrl_alt_ret_addr=GetRBP()(I64)+8;
|
||||
KbdPktRead;
|
||||
KbdPacketRead;
|
||||
}
|
||||
|
||||
U0 KbdInit()
|
||||
@ -483,10 +483,10 @@ I64 KbdMessagesQueue()
|
||||
return message_code;
|
||||
}
|
||||
|
||||
I64 KbdMsEvtTime()
|
||||
I64 KbdMouseEvtTime()
|
||||
{//Timestamp of last key or mouse event.
|
||||
if (ms_hard.timestamp>kbd.timestamp)
|
||||
return ms_hard.timestamp;
|
||||
if (mouse_hard.timestamp>kbd.timestamp)
|
||||
return mouse_hard.timestamp;
|
||||
else
|
||||
return kbd.new_key_timestamp;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE)
|
||||
//keyboard when in debugger with interrupts off.
|
||||
PUSHFD
|
||||
CLI
|
||||
KbdMsHandler(TRUE,FALSE);
|
||||
KbdMouseHandler(TRUE,FALSE);
|
||||
KbdMessagesQueue;
|
||||
POPFD
|
||||
} else {
|
||||
|
@ -1,124 +1,124 @@
|
||||
U0 GridInit()
|
||||
{//Init mouse grid struct. See $LK,"::/Demo/Graphics/Grid.HC"$.
|
||||
ms_grid.x=ms_grid.y=ms_grid.z=8;
|
||||
ms_grid.x_offset=ms_grid.y_offset=ms_grid.z_offset=0;
|
||||
ms_grid.x_speed =ms_grid.y_speed =ms_grid.z_speed =1;
|
||||
ms_grid.show=ms_grid.snap=ms_grid.coord=FALSE;
|
||||
mouse_grid.x=mouse_grid.y=mouse_grid.z=8;
|
||||
mouse_grid.x_offset=mouse_grid.y_offset=mouse_grid.z_offset=0;
|
||||
mouse_grid.x_speed =mouse_grid.y_speed =mouse_grid.z_speed =1;
|
||||
mouse_grid.show=mouse_grid.snap=mouse_grid.coord=FALSE;
|
||||
}
|
||||
|
||||
U0 MsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r)
|
||||
U0 MouseUpdate(I64 x,I64 y,I64 z,Bool l,Bool r)
|
||||
{
|
||||
ms.presnap.x=ToI64(ms.scale.x*x)+ms.offset.x;
|
||||
ms.presnap.y=ToI64(ms.scale.y*y)+ms.offset.y;
|
||||
ms.presnap.z=ToI64(ms.scale.z*z)+ms.offset.z;
|
||||
if (ms_grid.snap) {
|
||||
ms.pos.x=Trunc(ms.presnap.x/ms_grid.x)*ms_grid.x+ms_grid.x_offset;
|
||||
ms.pos.y=Trunc(ms.presnap.y/ms_grid.y)*ms_grid.y+ms_grid.y_offset;
|
||||
ms.pos.z=Trunc(ms.presnap.z/ms_grid.z)*ms_grid.z+ms_grid.z_offset;
|
||||
mouse.presnap.x=ToI64(mouse.scale.x*x)+mouse.offset.x;
|
||||
mouse.presnap.y=ToI64(mouse.scale.y*y)+mouse.offset.y;
|
||||
mouse.presnap.z=ToI64(mouse.scale.z*z)+mouse.offset.z;
|
||||
if (mouse_grid.snap) {
|
||||
mouse.pos.x=Trunc(mouse.presnap.x/mouse_grid.x)*mouse_grid.x+mouse_grid.x_offset;
|
||||
mouse.pos.y=Trunc(mouse.presnap.y/mouse_grid.y)*mouse_grid.y+mouse_grid.y_offset;
|
||||
mouse.pos.z=Trunc(mouse.presnap.z/mouse_grid.z)*mouse_grid.z+mouse_grid.z_offset;
|
||||
} else {
|
||||
ms.pos.x=ms.presnap.x;
|
||||
ms.pos.y=ms.presnap.y;
|
||||
ms.pos.z=ms.presnap.z;
|
||||
mouse.pos.x=mouse.presnap.x;
|
||||
mouse.pos.y=mouse.presnap.y;
|
||||
mouse.pos.z=mouse.presnap.z;
|
||||
}
|
||||
|
||||
ms.pos.x=ClampI64(ms.pos.x,0,GR_WIDTH-1);
|
||||
ms.pos.y=ClampI64(ms.pos.y,0,GR_HEIGHT-1);
|
||||
ms.pos_text.x=ms.pos.x/FONT_WIDTH;
|
||||
if (ms.pos_text.x>=text.cols) {
|
||||
ms.pos_text.x=text.cols-1;
|
||||
ms.pos.x=text.cols*FONT_WIDTH-1;
|
||||
mouse.pos.x=ClampI64(mouse.pos.x,0,GR_WIDTH-1);
|
||||
mouse.pos.y=ClampI64(mouse.pos.y,0,GR_HEIGHT-1);
|
||||
mouse.pos_text.x=mouse.pos.x/FONT_WIDTH;
|
||||
if (mouse.pos_text.x>=text.cols) {
|
||||
mouse.pos_text.x=text.cols-1;
|
||||
mouse.pos.x=text.cols*FONT_WIDTH-1;
|
||||
}
|
||||
ms.pos_text.y=ms.pos.y/FONT_HEIGHT;
|
||||
if (ms.pos_text.y>=text.rows) {
|
||||
ms.pos_text.y=text.rows-1;
|
||||
ms.pos.y=text.rows*FONT_HEIGHT-1;
|
||||
mouse.pos_text.y=mouse.pos.y/FONT_HEIGHT;
|
||||
if (mouse.pos_text.y>=text.rows) {
|
||||
mouse.pos_text.y=text.rows-1;
|
||||
mouse.pos.y=text.rows*FONT_HEIGHT-1;
|
||||
}
|
||||
ms.lb=l;
|
||||
ms.rb=r;
|
||||
LBEqu(&kbd.scan_code,SCf_MS_L_DOWN,ms.lb);
|
||||
LBEqu(&kbd.scan_code,SCf_MS_R_DOWN,ms.rb);
|
||||
mouse.lb=l;
|
||||
mouse.rb=r;
|
||||
LBEqu(&kbd.scan_code,SCf_MS_L_DOWN,mouse.lb);
|
||||
LBEqu(&kbd.scan_code,SCf_MS_R_DOWN,mouse.rb);
|
||||
}
|
||||
|
||||
U0 MsSet(I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,I64 l=I64_MAX,I64 r=I64_MAX)
|
||||
{//Note: Generates a message. See $LK,"MsSet",A="FF:::/Demo/Games/Zing.HC,MsSet"$().
|
||||
U0 MouseSet(I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,I64 l=I64_MAX,I64 r=I64_MAX)
|
||||
{//Note: Generates a message. See $LK,"MouseSet",A="FF:::/Demo/Games/Zing.HC,MouseSet"$().
|
||||
if (!(0<=x<GR_WIDTH))
|
||||
x=ms.pos.x;
|
||||
x=mouse.pos.x;
|
||||
if (!(0<=y<GR_HEIGHT))
|
||||
y=ms.pos.y;
|
||||
y=mouse.pos.y;
|
||||
if (z==I64_MAX)
|
||||
z=ms.pos.z;
|
||||
z=mouse.pos.z;
|
||||
|
||||
if (!(FALSE<=l<=TRUE))
|
||||
l=ms.lb;
|
||||
l=mouse.lb;
|
||||
if (!(FALSE<=r<=TRUE))
|
||||
r=ms.rb;
|
||||
r=mouse.rb;
|
||||
|
||||
x=(x-ms.offset.x)/ms.scale.x;
|
||||
y=(y-ms.offset.y)/ms.scale.y;
|
||||
z=(z-ms.offset.z)/ms.scale.z;
|
||||
MsUpdate(x,y,z,l,r);
|
||||
MsHardSet(x,y,z,l,r);
|
||||
x=(x-mouse.offset.x)/mouse.scale.x;
|
||||
y=(y-mouse.offset.y)/mouse.scale.y;
|
||||
z=(z-mouse.offset.z)/mouse.scale.z;
|
||||
MouseUpdate(x,y,z,l,r);
|
||||
MouseHardSet(x,y,z,l,r);
|
||||
}
|
||||
|
||||
U0 MsInit()
|
||||
U0 MouseInit()
|
||||
{
|
||||
MemSet(&ms,0,sizeof(CMsStateGlobals));
|
||||
MemSet(&ms_last,0,sizeof(CMsStateGlobals));
|
||||
ms.offset.x=ms.offset.y=ms.offset.z=0;
|
||||
ms.scale.x=ms.scale.y=ms.scale.z=1.0;
|
||||
ms.pos_text.x=ms.pos_text.y=ms.pos_text.z=0;
|
||||
ms.has_wheel=FALSE;
|
||||
ms.show=TRUE;
|
||||
ms.speed=0;
|
||||
ms.timestamp=GetTSC;
|
||||
ms.dbl_time=0.350;
|
||||
MemSet(&mouse,0,sizeof(CMouseStateGlobals));
|
||||
MemSet(&mouse_last,0,sizeof(CMouseStateGlobals));
|
||||
mouse.offset.x=mouse.offset.y=mouse.offset.z=0;
|
||||
mouse.scale.x=mouse.scale.y=mouse.scale.z=1.0;
|
||||
mouse.pos_text.x=mouse.pos_text.y=mouse.pos_text.z=0;
|
||||
mouse.has_wheel=FALSE;
|
||||
mouse.show=TRUE;
|
||||
mouse.speed=0;
|
||||
mouse.timestamp=GetTSC;
|
||||
mouse.dbl_time=0.350;
|
||||
GridInit;
|
||||
}
|
||||
|
||||
U0 MsHardPktRead()
|
||||
U0 MouseHardPacketRead()
|
||||
{
|
||||
U8 j;
|
||||
if (GetTSC>ms_hard.timestamp+counts.time_stamp_freq>>3)
|
||||
FifoU8Flush(ms_hard.fifo);
|
||||
ms_hard.timestamp=GetTSC;
|
||||
FifoU8Ins(ms_hard.fifo,InU8(KBD_PORT));
|
||||
if (FifoU8Count(ms_hard.fifo)==ms_hard.pkt_size)
|
||||
while (FifoU8Remove(ms_hard.fifo,&j))
|
||||
FifoU8Ins(ms_hard.fifo2,j);
|
||||
if (GetTSC>mouse_hard.timestamp+counts.time_stamp_freq>>3)
|
||||
FifoU8Flush(mouse_hard.fifo);
|
||||
mouse_hard.timestamp=GetTSC;
|
||||
FifoU8Ins(mouse_hard.fifo,InU8(KBD_PORT));
|
||||
if (FifoU8Count(mouse_hard.fifo)==mouse_hard.pkt_size)
|
||||
while (FifoU8Remove(mouse_hard.fifo,&j))
|
||||
FifoU8Ins(mouse_hard.fifo2,j);
|
||||
}
|
||||
|
||||
interrupt U0 IRQMsHard()
|
||||
interrupt U0 IRQMouseHard()
|
||||
{
|
||||
CLD
|
||||
OutU8(0xA0,0x20);
|
||||
OutU8(0x20,0x20);
|
||||
ms_hard.irqs_working=TRUE;
|
||||
if (ms_hard.install_in_progress || !ms_hard.installed) {
|
||||
mouse_hard.irqs_working=TRUE;
|
||||
if (mouse_hard.install_in_progress || !mouse_hard.installed) {
|
||||
kbd.reset=TRUE;
|
||||
return;
|
||||
}
|
||||
MsHardPktRead;
|
||||
MouseHardPacketRead;
|
||||
}
|
||||
|
||||
U0 MsHardGetType()
|
||||
U0 MouseHardGetType()
|
||||
{
|
||||
I64 b;
|
||||
KbdMsCmdAck(0xF2);
|
||||
KbdMouseCmdAck(0xF2);
|
||||
b=KbdCmdRead;
|
||||
if (b==3)
|
||||
ms_hard.has_wheel=TRUE;
|
||||
mouse_hard.has_wheel=TRUE;
|
||||
else if (b==4)
|
||||
ms_hard.has_ext_bttns=TRUE;
|
||||
mouse_hard.has_ext_bttns=TRUE;
|
||||
}
|
||||
|
||||
Bool MsHardReset()
|
||||
Bool MouseHardReset()
|
||||
{
|
||||
U8 b,*_b;
|
||||
F64 timeout;
|
||||
Bool res=FALSE;
|
||||
|
||||
ms_hard.has_wheel=FALSE;
|
||||
ms_hard.has_ext_bttns=FALSE;
|
||||
mouse_hard.has_wheel=FALSE;
|
||||
mouse_hard.has_ext_bttns=FALSE;
|
||||
|
||||
if (*0x40E(U16 *)==0x9FC0) {
|
||||
_b=0x9FC00+0x30;
|
||||
@ -131,7 +131,7 @@ Bool MsHardReset()
|
||||
KbdCmdSend(KBD_CTRL,0xAD); //Disable Kbd
|
||||
KbdCmdSend(KBD_CTRL,0xA8); //Enable Mouse
|
||||
|
||||
KbdMsCmdAck(0xFF); //Reset
|
||||
KbdMouseCmdAck(0xFF); //Reset
|
||||
|
||||
timeout=tS+10.0;
|
||||
do
|
||||
@ -147,11 +147,11 @@ Bool MsHardReset()
|
||||
catch
|
||||
Fs->catch_except=TRUE;
|
||||
|
||||
KbdMsCmdAck(0xF3,200,0xF3,100,0xF3,80);
|
||||
MsHardGetType;
|
||||
KbdMsCmdAck(0xF3,10);
|
||||
MsHardGetType;
|
||||
KbdMsCmdAck(0xE8,0x03,0xE6,0xF3,100,0xF4);
|
||||
KbdMouseCmdAck(0xF3,200,0xF3,100,0xF3,80);
|
||||
MouseHardGetType;
|
||||
KbdMouseCmdAck(0xF3,10);
|
||||
MouseHardGetType;
|
||||
KbdMouseCmdAck(0xE8,0x03,0xE6,0xF3,100,0xF4);
|
||||
res=TRUE;
|
||||
|
||||
//Enable IRQ 12
|
||||
@ -171,10 +171,10 @@ Bool MsHardReset()
|
||||
KbdCmdSend(KBD_CTRL,0xAE); //Enable Keyboard
|
||||
catch
|
||||
Fs->catch_except=TRUE;
|
||||
if (ms_hard.has_wheel || ms_hard.has_ext_bttns)
|
||||
ms_hard.pkt_size=4;
|
||||
if (mouse_hard.has_wheel || mouse_hard.has_ext_bttns)
|
||||
mouse_hard.pkt_size=4;
|
||||
else
|
||||
ms_hard.pkt_size=3;
|
||||
mouse_hard.pkt_size=3;
|
||||
if (!res)
|
||||
try
|
||||
KbdCmdSend(KBD_CTRL,0xA7); //Disable Mouse
|
||||
@ -183,185 +183,185 @@ Bool MsHardReset()
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 MsHardSpeedSet()
|
||||
U0 MouseHardSpeedSet()
|
||||
{
|
||||
I64 dd,tmp;
|
||||
if ((dd=SqrI64(ms_hard_last.pos.x-ms_hard.pos.x)
|
||||
+SqrI64(ms_hard_last.pos.y-ms_hard.pos.y)) &&
|
||||
(tmp=ms_hard.timestamp-ms_hard_last.timestamp))
|
||||
ms_hard.speed=Sqrt(dd)*counts.time_stamp_freq/tmp;
|
||||
ms_hard_last.timestamp=ms_hard.timestamp;
|
||||
if ((dd=SqrI64(mouse_hard_last.pos.x-mouse_hard.pos.x)
|
||||
+SqrI64(mouse_hard_last.pos.y-mouse_hard.pos.y)) &&
|
||||
(tmp=mouse_hard.timestamp-mouse_hard_last.timestamp))
|
||||
mouse_hard.speed=Sqrt(dd)*counts.time_stamp_freq/tmp;
|
||||
mouse_hard_last.timestamp=mouse_hard.timestamp;
|
||||
}
|
||||
|
||||
U0 MsHardSetPre()
|
||||
U0 MouseHardSetPre()
|
||||
{
|
||||
I64 old_timestamp=ms_hard_last.timestamp;
|
||||
MemCpy(&ms_hard_last,&ms_hard,sizeof(CMsHardStateGlobals));
|
||||
ms_hard_last.timestamp=old_timestamp;
|
||||
I64 old_timestamp=mouse_hard_last.timestamp;
|
||||
MemCpy(&mouse_hard_last,&mouse_hard,sizeof(CMouseHardStateGlobals));
|
||||
mouse_hard_last.timestamp=old_timestamp;
|
||||
}
|
||||
|
||||
U0 MsHardSetPost()
|
||||
U0 MouseHardSetPost()
|
||||
{
|
||||
I64 i;
|
||||
ms_hard.pos.x=ms_hard.prescale.x*ms_hard.scale.x*ms_grid.x_speed;
|
||||
ms_hard.pos.y=ms_hard.prescale.y*ms_hard.scale.y*ms_grid.y_speed;
|
||||
ms_hard.pos.z=ms_hard.prescale.z*ms_hard.scale.z*ms_grid.z_speed;
|
||||
mouse_hard.pos.x=mouse_hard.prescale.x*mouse_hard.scale.x*mouse_grid.x_speed;
|
||||
mouse_hard.pos.y=mouse_hard.prescale.y*mouse_hard.scale.y*mouse_grid.y_speed;
|
||||
mouse_hard.pos.z=mouse_hard.prescale.z*mouse_hard.scale.z*mouse_grid.z_speed;
|
||||
|
||||
i=Trunc(ms.scale.x*ms_hard.pos.x/ms_grid.x)*ms_grid.x+ms.offset.x;
|
||||
//TODO ms_grid.x_offset?
|
||||
i=Trunc(mouse.scale.x*mouse_hard.pos.x/mouse_grid.x)*mouse_grid.x+mouse.offset.x;
|
||||
//TODO mouse_grid.x_offset?
|
||||
if (i<0)
|
||||
ms.offset.x-=i;
|
||||
mouse.offset.x-=i;
|
||||
else if (i>=GR_WIDTH)
|
||||
ms.offset.x+=GR_WIDTH-1-i;
|
||||
mouse.offset.x+=GR_WIDTH-1-i;
|
||||
|
||||
i=Trunc(ms.scale.y*ms_hard.pos.y/ms_grid.y)*ms_grid.y+ms.offset.y;
|
||||
i=Trunc(mouse.scale.y*mouse_hard.pos.y/mouse_grid.y)*mouse_grid.y+mouse.offset.y;
|
||||
if (i<0)
|
||||
ms.offset.y-=i;
|
||||
mouse.offset.y-=i;
|
||||
else if (i>=GR_HEIGHT)
|
||||
ms.offset.y+=GR_HEIGHT-1-i;
|
||||
mouse.offset.y+=GR_HEIGHT-1-i;
|
||||
|
||||
if (ms_hard.pos.x!=ms_hard_last.pos.x || ms_hard.pos.y!=ms_hard_last.pos.y ||
|
||||
ms_hard.pos.z!=ms_hard_last.pos.z) {
|
||||
ms_hard.evt=TRUE;
|
||||
MsHardSpeedSet;
|
||||
if (mouse_hard.pos.x!=mouse_hard_last.pos.x || mouse_hard.pos.y!=mouse_hard_last.pos.y ||
|
||||
mouse_hard.pos.z!=mouse_hard_last.pos.z) {
|
||||
mouse_hard.evt=TRUE;
|
||||
MouseHardSpeedSet;
|
||||
} else
|
||||
for (i=0;i<5;i++)
|
||||
if (ms_hard.bttns[i]!=ms_hard_last.bttns[i]) {
|
||||
ms_hard.evt=TRUE;
|
||||
if (mouse_hard.bttns[i]!=mouse_hard_last.bttns[i]) {
|
||||
mouse_hard.evt=TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MsHardHandler()
|
||||
U0 MouseHardHandler()
|
||||
{
|
||||
I64 i,dx,dy,dz;
|
||||
U8 ms_buf[4];
|
||||
U8 mouse_buf[4];
|
||||
|
||||
MsHardSetPre;
|
||||
MouseHardSetPre;
|
||||
for (i=0;i<4;i++)
|
||||
ms_buf[i]=0;
|
||||
for (i=0;i<ms_hard.pkt_size;i++)
|
||||
if (!FifoU8Remove(ms_hard.fifo2,&ms_buf[i]))
|
||||
ms_buf[i]=0;
|
||||
mouse_buf[i]=0;
|
||||
for (i=0;i<mouse_hard.pkt_size;i++)
|
||||
if (!FifoU8Remove(mouse_hard.fifo2,&mouse_buf[i]))
|
||||
mouse_buf[i]=0;
|
||||
|
||||
ms_hard.bttns[0] = ms_buf[0] & 1;
|
||||
ms_hard.bttns[1] = (ms_buf[0] & 2) >> 1;
|
||||
ms_hard.bttns[2] = (ms_buf[0] & 4) >> 2;
|
||||
ms_hard.bttns[3] = (ms_buf[3] & 0x10) >> 4;
|
||||
ms_hard.bttns[4] = (ms_buf[3] & 0x20) >> 5;
|
||||
if (ms_buf[0] & 0x10)
|
||||
dx=ms_buf[1]-256;
|
||||
mouse_hard.bttns[0] = mouse_buf[0] & 1;
|
||||
mouse_hard.bttns[1] = (mouse_buf[0] & 2) >> 1;
|
||||
mouse_hard.bttns[2] = (mouse_buf[0] & 4) >> 2;
|
||||
mouse_hard.bttns[3] = (mouse_buf[3] & 0x10) >> 4;
|
||||
mouse_hard.bttns[4] = (mouse_buf[3] & 0x20) >> 5;
|
||||
if (mouse_buf[0] & 0x10)
|
||||
dx=mouse_buf[1]-256;
|
||||
else
|
||||
dx=ms_buf[1];
|
||||
if (ms_buf[0] & 0x20)
|
||||
dy=256-ms_buf[2];
|
||||
dx=mouse_buf[1];
|
||||
if (mouse_buf[0] & 0x20)
|
||||
dy=256-mouse_buf[2];
|
||||
else
|
||||
dy=-ms_buf[2];
|
||||
if (ms_buf[3] & 0x08)
|
||||
dz=ms_buf[3]&7-8;
|
||||
dy=-mouse_buf[2];
|
||||
if (mouse_buf[3] & 0x08)
|
||||
dz=mouse_buf[3]&7-8;
|
||||
else
|
||||
dz=ms_buf[3]&7;
|
||||
dz=mouse_buf[3]&7;
|
||||
|
||||
ms_hard.prescale.x+=dx;
|
||||
ms_hard.prescale.y+=dy;
|
||||
ms_hard.prescale.z+=dz;
|
||||
mouse_hard.prescale.x+=dx;
|
||||
mouse_hard.prescale.y+=dy;
|
||||
mouse_hard.prescale.z+=dz;
|
||||
|
||||
MsHardSetPost;
|
||||
MouseHardSetPost;
|
||||
}
|
||||
|
||||
U0 MsHardSet(I64 x,I64 y,I64 z,I64 l,I64 r)
|
||||
U0 MouseHardSet(I64 x,I64 y,I64 z,I64 l,I64 r)
|
||||
{
|
||||
ms_hard.timestamp=GetTSC;
|
||||
MsHardSetPre;
|
||||
ms_hard.prescale.x=x/ms_hard.scale.x/ms_grid.x_speed;
|
||||
ms_hard.prescale.y=y/ms_hard.scale.y/ms_grid.y_speed;
|
||||
ms_hard.prescale.z=z/ms_hard.scale.z/ms_grid.z_speed;
|
||||
ms_hard.bttns[0]=l;
|
||||
ms_hard.bttns[1]=r;
|
||||
MsHardSetPost;
|
||||
mouse_hard.timestamp=GetTSC;
|
||||
MouseHardSetPre;
|
||||
mouse_hard.prescale.x=x/mouse_hard.scale.x/mouse_grid.x_speed;
|
||||
mouse_hard.prescale.y=y/mouse_hard.scale.y/mouse_grid.y_speed;
|
||||
mouse_hard.prescale.z=z/mouse_hard.scale.z/mouse_grid.z_speed;
|
||||
mouse_hard.bttns[0]=l;
|
||||
mouse_hard.bttns[1]=r;
|
||||
MouseHardSetPost;
|
||||
}
|
||||
|
||||
U0 KbdMsReset()
|
||||
U0 KbdMouseReset()
|
||||
{
|
||||
KbdCmdFlush;
|
||||
FifoU8Flush(kbd.fifo2);
|
||||
FifoU8Flush(ms_hard.fifo2);
|
||||
FifoU8Flush(mouse_hard.fifo2);
|
||||
FifoI64Flush(kbd.scan_code_fifo);
|
||||
kbd.scan_code=0;
|
||||
kbd.reset=FALSE;
|
||||
}
|
||||
|
||||
Bool MsHardDriverInstall(I64 dummy=0) //can be spawned
|
||||
Bool MouseHardDriverInstall(I64 dummy=0) //can be spawned
|
||||
{
|
||||
no_warn dummy;
|
||||
I64 i;
|
||||
ms_hard.install_in_progress=TRUE;
|
||||
mouse_hard.install_in_progress=TRUE;
|
||||
OutU8(0xA1,InU8(0xA1)|0x10);
|
||||
ms_hard.installed=ms_hard.irqs_working=FALSE;
|
||||
IntEntrySet(0x2C,&IRQMsHard);
|
||||
mouse_hard.installed=mouse_hard.irqs_working=FALSE;
|
||||
IntEntrySet(0x2C,&IRQMouseHard);
|
||||
for(i=0;i<5;i++)
|
||||
ms_hard.bttns[i]=0;
|
||||
if (i=MsHardReset)
|
||||
mouse_hard.bttns[i]=0;
|
||||
if (i=MouseHardReset)
|
||||
OutU8(0xA1,InU8(0xA1)&~0x10);
|
||||
KbdMsReset;
|
||||
ms_hard.install_attempts++;
|
||||
ms_hard.installed=ms_hard.evt=i;
|
||||
ms_hard.install_in_progress=FALSE;
|
||||
return ms_hard.installed;
|
||||
KbdMouseReset;
|
||||
mouse_hard.install_attempts++;
|
||||
mouse_hard.installed=mouse_hard.evt=i;
|
||||
mouse_hard.install_in_progress=FALSE;
|
||||
return mouse_hard.installed;
|
||||
}
|
||||
|
||||
U0 KbdMsHandler(Bool poll_kbd,Bool poll_ms)
|
||||
U0 KbdMouseHandler(Bool poll_kbd,Bool poll_mouse)
|
||||
{
|
||||
if (ms_hard.install_in_progress) {
|
||||
if (mouse_hard.install_in_progress) {
|
||||
Yield;
|
||||
return;
|
||||
}
|
||||
if (kbd.reset)
|
||||
KbdMsReset;
|
||||
KbdMouseReset;
|
||||
else {
|
||||
if (poll_ms && ms_hard.installed && !ms_hard.irqs_working) {
|
||||
if (poll_mouse && mouse_hard.installed && !mouse_hard.irqs_working) {
|
||||
PUSHFD
|
||||
CLI
|
||||
while (InU8(KBD_CTRL)&1)
|
||||
MsHardPktRead;
|
||||
MouseHardPacketRead;
|
||||
POPFD
|
||||
}
|
||||
|
||||
if (poll_kbd)
|
||||
while (InU8(KBD_CTRL)&1)
|
||||
KbdPktRead;
|
||||
KbdPacketRead;
|
||||
|
||||
if (kbd.reset)
|
||||
KbdMsReset;
|
||||
KbdMouseReset;
|
||||
else {
|
||||
while (FifoU8Count(kbd.fifo2))
|
||||
KbdHandler;
|
||||
while (FifoU8Count(ms_hard.fifo2))
|
||||
if (ms_hard.installed)
|
||||
MsHardHandler;
|
||||
while (FifoU8Count(mouse_hard.fifo2))
|
||||
if (mouse_hard.installed)
|
||||
MouseHardHandler;
|
||||
else
|
||||
KbdMsReset;
|
||||
KbdMouseReset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U0 KbdMsInit()
|
||||
U0 KbdMouseInit()
|
||||
{
|
||||
MemSet(&kbd,0,sizeof(CKbdStateGlobals));
|
||||
kbd.fifo=FifoU8New(8);
|
||||
kbd.fifo2=FifoU8New(0x1000);
|
||||
kbd.scan_code_fifo=FifoI64New(0x1000);
|
||||
kbd.irqs_working=FALSE;
|
||||
MemSet(&ms_hard,0,sizeof(CMsHardStateGlobals));
|
||||
ms_hard.fifo=FifoU8New(8);
|
||||
ms_hard.fifo2=FifoU8New(0x1000);
|
||||
ms_hard.scale.x=0.5;
|
||||
ms_hard.scale.y=0.5;
|
||||
ms_hard.scale.z=1.0;
|
||||
ms_hard.prescale.x=GR_WIDTH/ms_hard.scale.x/2.0;
|
||||
ms_hard.prescale.y=GR_HEIGHT/ms_hard.scale.y/2.0;
|
||||
ms_hard.prescale.z=0/ms_hard.scale.z;
|
||||
ms_hard.pos.x=GR_WIDTH>>1;
|
||||
ms_hard.pos.y=GR_HEIGHT>>1;
|
||||
MemCpy(&ms_hard_last,&ms_hard,sizeof(CMsHardStateGlobals));
|
||||
MemSet(&mouse_hard,0,sizeof(CMouseHardStateGlobals));
|
||||
mouse_hard.fifo=FifoU8New(8);
|
||||
mouse_hard.fifo2=FifoU8New(0x1000);
|
||||
mouse_hard.scale.x=0.5;
|
||||
mouse_hard.scale.y=0.5;
|
||||
mouse_hard.scale.z=1.0;
|
||||
mouse_hard.prescale.x=GR_WIDTH/mouse_hard.scale.x/2.0;
|
||||
mouse_hard.prescale.y=GR_HEIGHT/mouse_hard.scale.y/2.0;
|
||||
mouse_hard.prescale.z=0/mouse_hard.scale.z;
|
||||
mouse_hard.pos.x=GR_WIDTH>>1;
|
||||
mouse_hard.pos.y=GR_HEIGHT>>1;
|
||||
MemCpy(&mouse_hard_last,&mouse_hard,sizeof(CMouseHardStateGlobals));
|
||||
}
|
||||
|
@ -205,8 +205,8 @@ U8 *sys_pos_pows_lets="KMGTPEZY",
|
||||
#define TMP_BUF_LEN 256
|
||||
#define SLOP 8
|
||||
|
||||
U8 *StrPrintJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv)
|
||||
{/*$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$
|
||||
U8 *StrPrintJoin(U8 *dst,U8 *format,I64 argc,I64 *argv)
|
||||
{/*$LK,"Print(\"\") Format Strings",A="FI:::/Doc/Print.DD"$
|
||||
In float formatting, do not exceed 18-digits
|
||||
before or after the decimal point
|
||||
because the numbers before and after
|
||||
@ -215,13 +215,13 @@ in 64-bits.Use exponentiated forms
|
||||
to avoid this.
|
||||
*/
|
||||
I64 i,j,l,ch,k,k0,n,n0,len,dec_len,flags,old_flags,
|
||||
aux_fmt_num,comma_count,comma_fmt_count,cur_arg=0;
|
||||
aux_format_num,comma_count,comma_format_count,cur_arg=0;
|
||||
U64 m;
|
||||
F64 d,d1;
|
||||
CDoc *doc;
|
||||
U8 *ptr,**_buf,*buf,**_dst,tmp_buf[TMP_BUF_LEN],tmp_buf2[TMP_BUF_LEN*2];
|
||||
|
||||
if (!fmt)
|
||||
if (!format)
|
||||
throw('StrPrint');
|
||||
if (dst) {
|
||||
_buf=NULL;
|
||||
@ -233,33 +233,33 @@ to avoid this.
|
||||
}
|
||||
_dst=&dst;
|
||||
|
||||
while (ch = *fmt++) {
|
||||
while (ch = *format++) {
|
||||
if (ch=='%') {
|
||||
flags=0;
|
||||
if (*fmt=='-') {
|
||||
if (*format=='-') {
|
||||
flags|=PRTF_LEFT_JUSTIFY;
|
||||
fmt++;
|
||||
format++;
|
||||
}
|
||||
if (*fmt=='0') {
|
||||
if (*format=='0') {
|
||||
flags|=PRTF_PAD_ZERO;
|
||||
fmt++;
|
||||
format++;
|
||||
}
|
||||
len=0;
|
||||
while ('0'<=*fmt<='9')
|
||||
len=len*10+ *fmt++ -'0';
|
||||
if (*fmt=='*') {
|
||||
fmt++;
|
||||
while ('0'<=*format<='9')
|
||||
len=len*10+ *format++ -'0';
|
||||
if (*format=='*') {
|
||||
format++;
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
len=argv[cur_arg++];
|
||||
}
|
||||
dec_len=0;
|
||||
if (*fmt=='.') {
|
||||
fmt++;
|
||||
while ('0'<=*fmt<='9')
|
||||
dec_len=dec_len*10+ *fmt++ -'0';
|
||||
if (*fmt=='*') {
|
||||
fmt++;
|
||||
if (*format=='.') {
|
||||
format++;
|
||||
while ('0'<=*format<='9')
|
||||
dec_len=dec_len*10+ *format++ -'0';
|
||||
if (*format=='*') {
|
||||
format++;
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
dec_len=argv[cur_arg++];
|
||||
@ -267,9 +267,9 @@ to avoid this.
|
||||
flags|=PRTF_DECIMAL;
|
||||
}
|
||||
|
||||
aux_fmt_num=0;
|
||||
aux_format_num=0;
|
||||
while (TRUE) {
|
||||
switch (*fmt) {
|
||||
switch (*format) {
|
||||
start:
|
||||
case '$$':
|
||||
flags|=PRTF_DOLLAR;
|
||||
@ -286,30 +286,30 @@ to avoid this.
|
||||
case 'l': //harmless
|
||||
break;
|
||||
end:
|
||||
fmt++;
|
||||
format++;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
fmt++;
|
||||
format++;
|
||||
flags|=PRTF_AUX_FMT_NUM;
|
||||
if (*fmt=='?') {
|
||||
fmt++;
|
||||
if (*format=='?') {
|
||||
format++;
|
||||
flags|=PRTF_QUESTION;
|
||||
} else {
|
||||
if (*fmt=='*') {
|
||||
fmt++;
|
||||
if (*format=='*') {
|
||||
format++;
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
aux_fmt_num=argv[cur_arg++];
|
||||
aux_format_num=argv[cur_arg++];
|
||||
} else {
|
||||
if (*fmt=='-') {
|
||||
fmt++;
|
||||
if (*format=='-') {
|
||||
format++;
|
||||
flags|=PRTF_NEG_AUX_FMT_NUM;
|
||||
}
|
||||
while ('0'<=*fmt<='9')
|
||||
aux_fmt_num=aux_fmt_num*10+ *fmt++ -'0';
|
||||
while ('0'<=*format<='9')
|
||||
aux_format_num=aux_format_num*10+ *format++ -'0';
|
||||
if (flags&PRTF_NEG_AUX_FMT_NUM)
|
||||
aux_fmt_num=-aux_fmt_num;
|
||||
aux_format_num=-aux_format_num;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -320,7 +320,7 @@ to avoid this.
|
||||
|
||||
sp_arg:
|
||||
k=0;
|
||||
switch (*fmt++) {
|
||||
switch (*format++) {
|
||||
start:
|
||||
case 'F':
|
||||
if (cur_arg>=argc)
|
||||
@ -406,8 +406,8 @@ to avoid this.
|
||||
break;
|
||||
end:
|
||||
if (!(flags&PRTF_AUX_FMT_NUM))
|
||||
aux_fmt_num=1;
|
||||
while (aux_fmt_num-->0)
|
||||
aux_format_num=1;
|
||||
while (aux_format_num-->0)
|
||||
OutStr(tmp_buf,_buf,_dst,len,flags);
|
||||
break;
|
||||
|
||||
@ -444,7 +444,7 @@ sp_out_dec:
|
||||
goto sp_out_eng;
|
||||
}
|
||||
if (flags&PRTF_COMMA) {
|
||||
comma_fmt_count=comma_count=3;
|
||||
comma_format_count=comma_count=3;
|
||||
do {
|
||||
tmp_buf[k++]=ModU64(&m,10)+'0';
|
||||
if (!m) break;
|
||||
@ -467,12 +467,12 @@ sp_out_comma_num:
|
||||
if (flags&PRTF_PAD_ZERO) {
|
||||
if (flags&PRTF_NEG)
|
||||
SPutChar(_dst,'-',_buf);
|
||||
comma_count=(len-k-i+comma_fmt_count-comma_count+1)
|
||||
%(comma_fmt_count+1)+1;
|
||||
comma_count=(len-k-i+comma_format_count-comma_count+1)
|
||||
%(comma_format_count+1)+1;
|
||||
for (;i<len-k;i++) {
|
||||
if (!--comma_count) {
|
||||
SPutChar(_dst,',',_buf);
|
||||
comma_count=comma_fmt_count;
|
||||
comma_count=comma_format_count;
|
||||
if (++i>=len-k)
|
||||
break;
|
||||
}
|
||||
@ -730,11 +730,11 @@ sp_out_eng: //Engineering notation
|
||||
j=0;
|
||||
} else {
|
||||
if (flags&PRTF_NEG_E)
|
||||
j=-n-aux_fmt_num;
|
||||
j=-n-aux_format_num;
|
||||
else
|
||||
j=n-aux_fmt_num;
|
||||
j=n-aux_format_num;
|
||||
d*=Pow10I64(j);
|
||||
i=aux_fmt_num/3;
|
||||
i=aux_format_num/3;
|
||||
}
|
||||
if (i<0)
|
||||
tmp_buf[k++]=sys_neg_pows_lets[-i];
|
||||
@ -789,7 +789,7 @@ sp_out_eng: //Engineering notation
|
||||
throw('StrPrint');
|
||||
m=argv[cur_arg++];
|
||||
if (flags&PRTF_COMMA) {
|
||||
comma_fmt_count=comma_count=4;
|
||||
comma_format_count=comma_count=4;
|
||||
do {
|
||||
tmp_buf[k]= m&15 +'0';
|
||||
if (tmp_buf[k]>'9') tmp_buf[k]+='A'-0x3A;
|
||||
@ -816,7 +816,7 @@ sp_out_eng: //Engineering notation
|
||||
throw('StrPrint');
|
||||
m=argv[cur_arg++];
|
||||
if (flags&PRTF_COMMA) {
|
||||
comma_fmt_count=comma_count=4;
|
||||
comma_format_count=comma_count=4;
|
||||
do {
|
||||
tmp_buf[k]= m&15 +'0';
|
||||
if (tmp_buf[k]>'9') tmp_buf[k]+='a'-0x3A;
|
||||
@ -844,7 +844,7 @@ sp_out_eng: //Engineering notation
|
||||
throw('StrPrint');
|
||||
m=argv[cur_arg++];
|
||||
if (flags&PRTF_COMMA) {
|
||||
comma_fmt_count=comma_count=4;
|
||||
comma_format_count=comma_count=4;
|
||||
do {
|
||||
tmp_buf[k++]= m&1 +'0';
|
||||
m>>=1;
|
||||
@ -873,47 +873,47 @@ sp_out_eng: //Engineering notation
|
||||
return buf;
|
||||
}
|
||||
|
||||
U8 *StrPrint(U8 *dst,U8 *fmt,...)
|
||||
U8 *StrPrint(U8 *dst,U8 *format,...)
|
||||
{//See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
return StrPrintJoin(dst,fmt,argc,argv);
|
||||
return StrPrintJoin(dst,format,argc,argv);
|
||||
}
|
||||
|
||||
U8 *CatPrint(U8 *_dst,U8 *fmt,...)
|
||||
U8 *CatPrint(U8 *_dst,U8 *format,...)
|
||||
{//StrCat().See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
U8 *dst=_dst;
|
||||
while (*dst)
|
||||
dst++;
|
||||
StrPrintJoin(dst,fmt,argc,argv);
|
||||
StrPrintJoin(dst,format,argc,argv);
|
||||
return _dst;
|
||||
}
|
||||
|
||||
U0 Print(U8 *fmt,...)
|
||||
{//$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$.See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
U0 Print(U8 *format,...)
|
||||
{//$LK,"Print(\"\") Format Strings",A="FI:::/Doc/Print.DD"$.See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
PutS(buf);//Don't use PutS(). $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U8 *MStrPrint(U8 *fmt,...)
|
||||
U8 *MStrPrint(U8 *format,...)
|
||||
{//MAlloc StrPrint.See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
U8 *res,*buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *res,*buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
res=StrNew(buf);
|
||||
Free(buf);
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 PrintErr(U8 *fmt,...)
|
||||
U0 PrintErr(U8 *format,...)
|
||||
{//Print "Err:" and message in blinking red.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
GetOutOfDollar;
|
||||
"%,p %,p %,p %,p " ST_ERR_ST "%s",Caller,Caller(2),Caller(3),Caller(4),buf;
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U0 PrintWarn(U8 *fmt,...)
|
||||
U0 PrintWarn(U8 *format,...)
|
||||
{//Print "Warn:" and message in blinking red.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
GetOutOfDollar;
|
||||
"%,p %,p %,p %,p " ST_WARN_ST "%s",Caller,Caller(2),Caller(3),Caller(4),buf;
|
||||
Free(buf);
|
||||
|
@ -209,7 +209,7 @@ today.
|
||||
return res-local_time_offset;
|
||||
}
|
||||
|
||||
U8 *StrScan(U8 *src,U8 *fmt,...)
|
||||
U8 *StrScan(U8 *src,U8 *format,...)
|
||||
{/*Opposite of sprintf().Pass ptrs to data to be scanned-in.
|
||||
For "%s", pass ptr to ptr (be careful because addr
|
||||
of array is the same as array--create ptr to array
|
||||
@ -219,46 +219,46 @@ and take addr.
|
||||
Bool left_justify=FALSE;
|
||||
I64 ch,cur_arg=0,i,len,*i_ptr,dec_len;
|
||||
F64 *d_ptr;
|
||||
if (!fmt)
|
||||
if (!format)
|
||||
throw('Scan');
|
||||
while (ch = *fmt++) {
|
||||
while (ch = *format++) {
|
||||
if (ch=='%') {
|
||||
if (*fmt=='%') {
|
||||
if (*format=='%') {
|
||||
src++;
|
||||
fmt++;
|
||||
format++;
|
||||
} else {
|
||||
if (*fmt=='-') {
|
||||
if (*format=='-') {
|
||||
left_justify=TRUE;
|
||||
fmt++;
|
||||
format++;
|
||||
} else
|
||||
left_justify=FALSE;
|
||||
len=0;
|
||||
while ('0'<=*fmt<='9')
|
||||
len=len*10+ (*fmt++ -'0');
|
||||
if (*fmt=='*') {
|
||||
fmt++;
|
||||
while ('0'<=*format<='9')
|
||||
len=len*10+ (*format++ -'0');
|
||||
if (*format=='*') {
|
||||
format++;
|
||||
if (cur_arg>=argc)
|
||||
throw('Scan');
|
||||
len=argv[cur_arg++];
|
||||
}
|
||||
ch=*fmt++;
|
||||
ch=*format++;
|
||||
if (ch && !len) {
|
||||
ptr=src;
|
||||
while (*ptr && *ptr!=*fmt)
|
||||
while (*ptr && *ptr!=*format)
|
||||
ptr++;
|
||||
len=ptr-src;
|
||||
} else {
|
||||
if (ch=='.') {
|
||||
dec_len=0;
|
||||
while ('0'<=*fmt<='9')
|
||||
dec_len=dec_len*10+ (*fmt++-'0');
|
||||
if (*fmt=='*') {
|
||||
fmt++;
|
||||
while ('0'<=*format<='9')
|
||||
dec_len=dec_len*10+ (*format++-'0');
|
||||
if (*format=='*') {
|
||||
format++;
|
||||
if (cur_arg>=argc)
|
||||
throw('Scan');
|
||||
dec_len=argv[cur_arg++];
|
||||
}
|
||||
ch=*fmt++;
|
||||
ch=*format++;
|
||||
}
|
||||
}
|
||||
buf=MAlloc(len+1);
|
||||
|
@ -1,6 +1,6 @@
|
||||
//Make Your own Distro by #include-ing this file.
|
||||
|
||||
#define STD_DISTRO_DVD_CFG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
|
||||
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
|
||||
|
||||
U0 MakeMyISO(U8 *_out_iso_filename)
|
||||
{//Does everything with current drive.
|
||||
@ -14,7 +14,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
|
||||
Del(out_iso_filename);
|
||||
|
||||
DirMk("/Distro");
|
||||
In(STD_DISTRO_DVD_CFG);
|
||||
In(STD_DISTRO_DVD_CONFIG);
|
||||
BootDVDIns;
|
||||
|
||||
Copy("/*","/Distro");
|
||||
@ -46,4 +46,4 @@ U0 MakeMyISO(U8 *_out_iso_filename)
|
||||
|
||||
MakeMyISO("/Tmp/MyDistro.ISO.C");
|
||||
|
||||
// Study my account examples $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.
|
||||
// Study my account examples $LK,"Config Strs",A="FL:::/Demo/AcctExample/TOS/TOSConfig.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.
|
||||
|
@ -144,9 +144,9 @@ U0 RegularInstallWiz()
|
||||
'\n';
|
||||
} while (!('1'<=ch<='2'));
|
||||
if (ch=='1')
|
||||
Fmt(drv_let,,FALSE,FSt_FAT32);
|
||||
Format(drv_let,,FALSE,FSt_FAT32);
|
||||
else
|
||||
Fmt(drv_let,,FALSE,FSt_REDSEA);
|
||||
Format(drv_let,,FALSE,FSt_REDSEA);
|
||||
}
|
||||
InstallDrive(drv_let);
|
||||
XTalkWait(task,"BootHDIns('%C');\n\nB\n0x20000\n"
|
||||
|
@ -509,8 +509,8 @@ U0 DoPixCollision()
|
||||
XTalkWait(task,"#include \"::/Demo/Graphics/Collision\";\n");
|
||||
w=task->pix_width>>1 +task->pix_left+task->scroll_x;
|
||||
h=task->pix_height>>1+task->pix_top +task->scroll_y;
|
||||
MsSet(w-35,h-35);
|
||||
InSetMs(10,w+35,w+35);
|
||||
MouseSet(w-35,h-35);
|
||||
InSetMouse(10,w+35,w+35);
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SPACE,0);
|
||||
DeathWait(&task,TRUE);
|
||||
}
|
||||
@ -781,9 +781,9 @@ U0 DoBattleLines()
|
||||
TaskWait(task->popup_task);
|
||||
PostMessageWait(task->popup_task,MESSAGE_KEY_DOWN_UP,CH_SPACE,0);
|
||||
DeathWait(&task->popup_task);
|
||||
MsSet(430,300,,TRUE);
|
||||
InSetMs(10,530,400);
|
||||
MsSet(,,,FALSE);
|
||||
MouseSet(430,300,,TRUE);
|
||||
InSetMouse(10,530,400);
|
||||
MouseSet(,,,FALSE);
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SHIFT_ESC,0);
|
||||
DeathWait(&task,TRUE);
|
||||
}
|
||||
@ -931,61 +931,61 @@ U0 DoStrut()
|
||||
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SPACE,0);
|
||||
|
||||
MsSet(200,200,,TRUE);
|
||||
MouseSet(200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
Refresh(2);
|
||||
|
||||
MsSet(GR_WIDTH-200,200,,TRUE);
|
||||
MouseSet(GR_WIDTH-200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
|
||||
MsSet(GR_WIDTH/2,400,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,400,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,'s',0);
|
||||
|
||||
MsSet(200,200,,TRUE);
|
||||
MouseSet(200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(GR_WIDTH-200,200,,TRUE);
|
||||
MouseSet(GR_WIDTH-200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
MsSet(200,200,,TRUE);
|
||||
MouseSet(200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(GR_WIDTH/2,400,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,400,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
MsSet(GR_WIDTH-200,200,,TRUE);
|
||||
MouseSet(GR_WIDTH-200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(GR_WIDTH/2,400,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,400,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
MsSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(GR_WIDTH-200,200,,TRUE);
|
||||
MouseSet(GR_WIDTH-200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
MsSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(GR_WIDTH/2,400,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,400,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
MsSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,GR_HEIGHT/2,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(200,200,,TRUE);
|
||||
MouseSet(200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,'t',0);
|
||||
|
||||
MsSet(GR_WIDTH/2,400,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,400,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(GR_WIDTH-200,200,,TRUE);
|
||||
MouseSet(GR_WIDTH-200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
MsSet(GR_WIDTH/2,400,,TRUE);
|
||||
MouseSet(GR_WIDTH/2,400,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_DOWN,0,0);
|
||||
MsSet(200,200,,TRUE);
|
||||
MouseSet(200,200,,TRUE);
|
||||
PostMessageWait(task,MESSAGE_MS_L_UP,0,0);
|
||||
|
||||
MsSet(,,,FALSE);
|
||||
MouseSet(,,,FALSE);
|
||||
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SPACE,0);
|
||||
LBts(kbd.down_bitmap,Char2ScanCode('1'));
|
||||
@ -1028,11 +1028,11 @@ U0 DoWhap()
|
||||
{
|
||||
CTask *task=User;
|
||||
XTalkWait(task,"#include \"::/Demo/Games/Whap\";\n");
|
||||
MsSet(300,200);
|
||||
MouseSet(300,200);
|
||||
Sleep(500);
|
||||
InSetMs(3,350,300);
|
||||
InSetMouse(3,350,300);
|
||||
Sleep(500);
|
||||
InSetMs(3,450,200);
|
||||
InSetMouse(3,450,200);
|
||||
Sleep(500);
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SHIFT_ESC,0);
|
||||
DeathWait(&task,TRUE);
|
||||
@ -1041,14 +1041,14 @@ U0 DoWhap()
|
||||
U0 DoGrid()
|
||||
{
|
||||
CTask *task=User("#include \"::/Demo/Graphics/Grid\";\n");
|
||||
MsSet(200,200);
|
||||
MouseSet(200,200);
|
||||
Sleep(150);
|
||||
InSetMs(2,400,400);
|
||||
InSetMs(2,200,400);
|
||||
InSetMs(2,200,200);
|
||||
MsSet(,,,TRUE);
|
||||
InSetMouse(2,400,400);
|
||||
InSetMouse(2,200,400);
|
||||
InSetMouse(2,200,200);
|
||||
MouseSet(,,,TRUE);
|
||||
Sleep(50);
|
||||
MsSet(,,,FALSE);
|
||||
MouseSet(,,,FALSE);
|
||||
DocBottom(DocPut(task));
|
||||
DeathWait(&task,TRUE);
|
||||
}
|
||||
@ -1057,11 +1057,11 @@ U0 DoPick()
|
||||
{
|
||||
CTask *task=User;
|
||||
XTalkWait(task,"#include \"::/Demo/Graphics/Pick\";\n");
|
||||
MsSet(200,200);
|
||||
MouseSet(200,200);
|
||||
Sleep(500);
|
||||
MsSet(,,,TRUE);
|
||||
InSetMs(4,400,400);
|
||||
MsSet(,,,FALSE);
|
||||
MouseSet(,,,TRUE);
|
||||
InSetMouse(4,400,400);
|
||||
MouseSet(,,,FALSE);
|
||||
Sleep(500);
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SHIFT_ESC,0);
|
||||
DeathWait(&task,TRUE);
|
||||
@ -1071,11 +1071,11 @@ U0 DoPick3D()
|
||||
{
|
||||
CTask *task=User;
|
||||
XTalkWait(task,"#include \"::/Demo/Graphics/Pick3D\";\n");
|
||||
MsSet(200,200);
|
||||
MouseSet(200,200);
|
||||
Sleep(500);
|
||||
MsSet(,,,TRUE);
|
||||
InSetMs(4,400,400);
|
||||
MsSet(,,,FALSE);
|
||||
MouseSet(,,,TRUE);
|
||||
InSetMouse(4,400,400);
|
||||
MouseSet(,,,FALSE);
|
||||
Sleep(500);
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SHIFT_ESC,0);
|
||||
DeathWait(&task,TRUE);
|
||||
@ -1106,9 +1106,9 @@ U0 DoKeepAway()
|
||||
BirthWait(&task->popup_task);
|
||||
TaskWait(task->popup_task);
|
||||
PostMessageWait(task->popup_task,MESSAGE_KEY_DOWN_UP,CH_SPACE,0);
|
||||
MsSet(100,100);
|
||||
MouseSet(100,100);
|
||||
Sleep(1500);
|
||||
PostMessageWait(task,MESSAGE_MS_R_DOWN_UP,ms.pos.x,ms.pos.y);
|
||||
PostMessageWait(task,MESSAGE_MS_R_DOWN_UP,mouse.pos.x,mouse.pos.y);
|
||||
Sleep(1000);
|
||||
PostMessageWait(task,MESSAGE_KEY_DOWN_UP,CH_SHIFT_ESC,0);
|
||||
DeathWait(&task,TRUE);
|
||||
|
@ -4682,7 +4682,7 @@
|
||||
0076 2U6MLA-35295-M5-E Xircom MPCI3B-56G (Lucent SCORPIO) Soft
|
||||
00d3 2333333333333 Xircom MPCI Modem 56
|
||||
00D4 MPCI Modem 56k
|
||||
0101 Ms0612006303 CardBus 56k Modem
|
||||
0101 Mouse0612006303 CardBus 56k Modem
|
||||
0103 CardBus Ehternet + 56k Modem
|
||||
115E Peer Protocols Inc
|
||||
115F Maxtor Corporation
|
||||
|
Binary file not shown.
@ -83,7 +83,7 @@ public U8 *ACDDefsGet(U8 *st)
|
||||
return res;
|
||||
}
|
||||
|
||||
/*Fmt of word list entry:
|
||||
/*Format of word list entry:
|
||||
U8 ACD_WORD_CHAR
|
||||
U8 word[] with terminating zero
|
||||
I16 block;
|
||||
|
@ -227,7 +227,7 @@ U0 ACTask(I64)
|
||||
ac.cur_word=NULL;
|
||||
while (TRUE) {
|
||||
if (scan_code&(SCF_CTRL|SCF_ALT) ||
|
||||
GetTSC>KbdMsEvtTime+counts.time_stamp_freq>>1) {
|
||||
GetTSC>KbdMouseEvtTime+counts.time_stamp_freq>>1) {
|
||||
last_scan_code=scan_code;
|
||||
scan_code=kbd.scan_code;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user