hndlr -> handler, msg -> message

This commit is contained in:
xmm15 2020-02-15 17:56:05 -06:00
parent 2106e15648
commit 5576cee060
136 changed files with 1807 additions and 1767 deletions

Binary file not shown.

Binary file not shown.

View file

@ -633,7 +633,7 @@ U0 Init()
U0 KeepAway()
{
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
PopUpOk(
"Pass or hand-off to your team to score points.$$FG$$\n\n"
@ -669,18 +669,18 @@ U0 KeepAway()
try {
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_MS_L_DOWN|1<<MSG_MS_R_DOWN|1<<MSG_KEY_DOWN);
switch (msg_code) {
case MSG_MS_L_DOWN:
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_R_DOWN|1<<MESSAGE_KEY_DOWN);
switch (message_code) {
case MESSAGE_MS_L_DOWN:
ka_shoot:
Shoot(human);
break;
case MSG_MS_R_DOWN:
case MESSAGE_MS_R_DOWN:
ka_jump:
human->DzDt=JUMP_VELOCITY;
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
Init;
@ -697,7 +697,7 @@ ka_jump:
}
}
ka_done: //Don't goto out of try
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

View file

@ -1,4 +1,4 @@
CTask *JukeReward(U8 *msg)
CTask *JukeReward(U8 *message)
{
U8 *buf;
CDoc *doc;
@ -7,7 +7,7 @@ CTask *JukeReward(U8 *msg)
res->title_src=TTS_LOCKED_CONST;
doc=DocNew(,res);
DocPrint(doc,"$$WW+H,1$$$$RED$$%s",msg);
DocPrint(doc,"$$WW+H,1$$$$RED$$%s",message);
buf=MStrPrint("DocEd(0x%X);",doc);
TaskExe(res,NULL,buf,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
@ -25,7 +25,7 @@ CTask *JukeReward(U8 *msg)
return res;
}
CTask *SingleSong(U8 *msg,U8 *name)
CTask *SingleSong(U8 *message,U8 *name)
{
CTask *task=Spawn(&SrvCmdLine,NULL,name,,Fs);
StrCpy(task->task_title,name);
@ -34,7 +34,7 @@ CTask *SingleSong(U8 *msg,U8 *name)
WinHorz(task->win_left,task->win_left+50,task);
WinVert(2,2+8,task);
task->win_inhibit=WIG_NO_FOCUS_TASK_DFT;
TaskExe(task,NULL,msg,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
TaskExe(task,NULL,message,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
DocPut(task)->max_entries=100;
return task;
}

View file

@ -36,14 +36,14 @@ U0 JukeSongPuppet(CTask *juke_task,I64 passes,I64 song_num,U8 *name)
FileExtRemove(name);
BirthWait(&juke_task->popup_task);
TaskWait(juke_task->popup_task);
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL);
PostMessage(juke_task->popup_task,MESSAGE_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL);
TaskWait(juke_task->popup_task);
for (i=0;i<song_num;i++) {
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT);
PostMessage(juke_task->popup_task,MESSAGE_KEY_DOWN_UP,0,SC_CURSOR_RIGHT);
TaskWait(juke_task->popup_task);
}
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,CH_SPACE,0);
PostMessage(juke_task->popup_task,MESSAGE_KEY_DOWN_UP,CH_SPACE,0);
TaskWait(juke_task->popup_task);
Sleep(500);
@ -59,10 +59,10 @@ U0 JukeSongPuppet(CTask *juke_task,I64 passes,I64 song_num,U8 *name)
if (found) {//Position cursor on song title during song
TaskWait(juke_task->popup_task);
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL);
PostMessage(juke_task->popup_task,MESSAGE_KEY_DOWN_UP,0,SC_CURSOR_UP+SCF_CTRL);
TaskWait(juke_task->popup_task);
for (i=0;i<song_num;i++) {
PostMsg(juke_task->popup_task,MSG_KEY_DOWN_UP,0,SC_CURSOR_RIGHT);
PostMessage(juke_task->popup_task,MESSAGE_KEY_DOWN_UP,0,SC_CURSOR_RIGHT);
TaskWait(juke_task->popup_task);
}
SongPuppet(task,passes);

View file

@ -388,7 +388,7 @@ U0 PsmMenu(I64 psm_octave)
"$$LTGREEN$$Left Mouse$$FG$$\tDrag note or shift word\n"
"$$LTGREEN$$Right Mouse$$FG$$\tChange duration or set word\n";
Sprite($IB,"<6>",BI=6$,"$$SP+LIS,\"\","
"LM=\"Msg(MSG_KEY_DOWN,0,SCF_CTRL|SC_CURSOR_LEFT);\",BI=%d$$");
"LM=\"Message(MESSAGE_KEY_DOWN,0,SCF_CTRL|SC_CURSOR_LEFT);\",BI=%d$$");
"";
if (psm.playing)
Sprite($IB,"<9>",BI=9$,"$$SP,\"\",LM=\"x\",BI=%d$$");
@ -402,7 +402,7 @@ U0 PsmMenu(I64 psm_octave)
Sprite($IB,"<11>",BI=11$,"$$SP,\"\",LM=\"z\",BI=%d$$");
"";
Sprite($IB,"<7>",BI=7$,"$$SP+LIS,\"\","
"LM=\"Msg(MSG_KEY_DOWN,0,SCF_CTRL|SC_CURSOR_RIGHT);\",BI=%d$$");
"LM=\"Message(MESSAGE_KEY_DOWN,0,SCF_CTRL|SC_CURSOR_RIGHT);\",BI=%d$$");
"$$CM+LX,0,6$$";
PsmSetOctave(psm_octave);
Refresh(2);

View file

@ -107,15 +107,15 @@ U0 PsmRightClick(I64 x,I64 y)
U0 PsmLeftClickPickNoteBox(I64 duration)
{
I64 o,n,msg_code,arg1,arg2;
I64 o,n,message_code,arg1,arg2;
PsmNote *tmpn,*tmpn1;
do {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP|1<<MSG_MS_MOVE);
if (msg_code==MSG_MS_MOVE) {
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP|1<<MESSAGE_MS_MOVE);
if (message_code==MESSAGE_MS_MOVE) {
DrawDC2;
DrawNote(psm.dc2,arg1,arg2,duration);
}
} while (msg_code!=MSG_MS_L_UP);
} while (message_code!=MESSAGE_MS_L_UP);
if (arg2<13*FONT_HEIGHT) {
if (arg1>psm.head.last->x)
tmpn1=psm.head.last;
@ -146,15 +146,15 @@ U0 PsmLeftClickPickNoteBox(I64 duration)
U0 PsmLeftClickPickMeterBox(I64 top,I64 bottom)
{
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
PsmNote *tmpn,*tmpn1;
do {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP|1<<MSG_MS_MOVE);
if (msg_code==MSG_MS_MOVE) {
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP|1<<MESSAGE_MS_MOVE);
if (message_code==MESSAGE_MS_MOVE) {
DrawDC2;
DrawTimeSignature(psm.dc2,arg1,arg2,top,bottom);
}
} while (msg_code!=MSG_MS_L_UP);
} while (message_code!=MESSAGE_MS_L_UP);
if (arg2<13*FONT_HEIGHT) {
if (arg1>=psm.head.x)
tmpn1=psm.head.last;
@ -176,15 +176,15 @@ U0 PsmLeftClickPickMeterBox(I64 top,I64 bottom)
U0 PsmLeftClickStaffPtr(I64 x,I64 y)
{
PsmNote *tmpn,*tmpn1;
I64 o,n,msg_code,arg1,arg2,n_original,o_original;
I64 o,n,message_code,arg1,arg2,n_original,o_original;
psm.cur_note=tmpn=PsmFindNote(x,y);
if (tmpn!=&psm.head) {
if (tmpn->type==PSMT_NOTE) {
o_original=Ona2Octave(tmpn->ona);
n_original=Ona2Note (tmpn->ona);
do {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP|1<<MSG_MS_MOVE);
if (msg_code==MSG_MS_L_UP) {
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP|1<<MESSAGE_MS_MOVE);
if (message_code==MESSAGE_MS_L_UP) {
tmpn1=PsmFindNote(arg1,arg2);
if (tmpn1==&psm.head || tmpn1==tmpn)
goto move_note;
@ -208,7 +208,7 @@ move_note:
o--;
tmpn->ona=Note2Ona(n,o);
}
} while (msg_code!=MSG_MS_L_UP);
} while (message_code!=MESSAGE_MS_L_UP);
PsmSetWidth(tmpn);
}
}
@ -216,17 +216,17 @@ move_note:
U0 PsmLeftClickStaffBox(I64 x,I64 y)
{
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
do {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP|1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP|1<<MESSAGE_MS_MOVE);
DrawDC2;
psm.dc2->color=ROPF_DITHER+WHITE<<16+BLACK;
GrBorder(psm.dc2,x,y,arg1,arg2);
if (msg_code==MSG_MS_L_UP) {
if (message_code==MESSAGE_MS_L_UP) {
if (x>arg1) SwapI64(&x,&arg1);
PsmMarkSel(x,arg1,TRUE);
}
} while (msg_code!=MSG_MS_L_UP);
} while (message_code!=MESSAGE_MS_L_UP);
DrawDC2;
}
@ -307,7 +307,7 @@ U0 PsmDownKey(I64 x,I64 y)
for (i=0;i<PSM_KEYS_NUM;i++) {
o=&psm_kbd[i];
if (o->x<=x<o->x+o->w && y<o->h) {
Msg(MSG_KEY_DOWN,o->ascii,0);
Message(MESSAGE_KEY_DOWN,o->ascii,0);
return;
}
}
@ -324,7 +324,7 @@ U0 PsmUpKey(I64 x,I64 y)
for (i=0;i<PSM_KEYS_NUM;i++) {
o=&psm_kbd[i];
if (o->x<=x<o->x+o->w && y<o->h) {
Msg(MSG_KEY_UP,o->ascii,0);
Message(MESSAGE_KEY_UP,o->ascii,0);
return;
}
}
@ -350,7 +350,7 @@ U0 PsmPopMode()
U0 Psalmody(U8 *dirname="~/Psalmody")
{
Bool was_playing,is_null=TRUE,was_null=TRUE;
I64 arg1,arg2,msg_code=0,col,ona=0,last_ona=0,
I64 arg1,arg2,message_code=0,col,ona=0,last_ona=0,
psm_octave=4,timeout_val,timeout_val2,old_doc_flags;
U8 *filename=NULL,*st,*st2;
PsmNote *tmpn;
@ -376,7 +376,7 @@ U0 Psalmody(U8 *dirname="~/Psalmody")
MenuPush(
"File {"
" New(,'.');"
" ChgDir(MSG_CMD,PSMF_CD);"
" ChgDir(MESSAGE_CMD,PSMF_CD);"
" Open(,CH_CTRLO);"
" SaveAs(,CH_CTRLA);"
" Abort(,CH_SHIFT_ESC);"
@ -399,7 +399,7 @@ U0 Psalmody(U8 *dirname="~/Psalmody")
" Play(,'x');"
" Record(,'z');"
" Random(,',');"
" MarkIncomplete(MSG_CMD,PSMF_INCOMPLETE);"
" MarkIncomplete(MESSAGE_CMD,PSMF_INCOMPLETE);"
"}"
"Snd {"
" Octave1(,'1');"
@ -431,22 +431,22 @@ U0 Psalmody(U8 *dirname="~/Psalmody")
was_playing=FALSE;
mo_start:
if (ms.pos_text.y-Fs->win_top<18)
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP|
1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|1<<MSG_MS_R_UP|
1<<MSG_MS_MOVE|1<<MSG_CMD);
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);
else
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP|
1<<MSG_MS_MOVE|1<<MSG_CMD);
mo_got_msg:
if (msg_code==MSG_KEY_DOWN && arg1==CH_SPACE && !arg2) {
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP|
1<<MESSAGE_MS_MOVE|1<<MESSAGE_CMD);
mo_got_message:
if (message_code==MESSAGE_KEY_DOWN && arg1==CH_SPACE && !arg2) {
//The Window Mgr sets the Doc cur_entry to a bttn
//and generates a <SPACE> when the Doc Bttns are clicked.
//This is so that kbd and mouse are the same for Doc's.
//We must now pass the <SPACE> onto the Doc hndlr.
//We must now pass the <SPACE> onto the Doc handler.
PutKey(arg1,arg2);
goto mo_start;
}
if (msg_code!=MSG_MS_MOVE) {
if (message_code!=MESSAGE_MS_MOVE) {
DocBottom;
if (was_playing || DocPut->cur_entry->y>=Fs->win_height-2) {
PsmMenu(psm_octave);
@ -456,8 +456,8 @@ mo_got_msg:
ona=Note2Ona(3,psm_octave+1); //C
is_null=TRUE;
switch (msg_code) {
case MSG_CMD:
switch (message_code) {
case MESSAGE_CMD:
PsmPopMode;
switch (arg1) {
case PSMF_CD:
@ -476,7 +476,7 @@ mo_got_msg:
PsmPushMode(psm_octave);
col=0;
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
evt_time=tS;
if ('0'<=arg1<='9') {
psm_octave=arg1-'0';
@ -643,20 +643,20 @@ mo_got_msg:
if (tmpn->type!=PSMT_METER) {
timeout_val=cnts.jiffies;
if (ms.pos_text.y-Fs->win_top<18)
msg_code=ScanMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|
1<<MSG_MS_L_DOWN|1<<MSG_MS_R_UP|1<<MSG_CMD);
message_code=ScanMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|
1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_R_UP|1<<MESSAGE_CMD);
else
msg_code=ScanMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|
1<<MSG_MS_L_DOWN|1<<MSG_CMD);
if (msg_code) {
message_code=ScanMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|
1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_CMD);
if (message_code) {
Snd;
psm.playing=FALSE;
was_playing=TRUE;
if (ms.pos_text.y-Fs->win_top>=18 &&
msg_code==MSG_MS_L_DOWN)
message_code==MESSAGE_MS_L_DOWN)
goto mo_start;
else
goto mo_got_msg;
goto mo_got_message;
}
psm.cur_note=tmpn;
psm.scrn_x+=tmpn->x-0.33*GR_WIDTH;
@ -721,21 +721,21 @@ mo_got_msg:
}
}
break;
case MSG_KEY_UP:
case MESSAGE_KEY_UP:
evt_time=tS;
break;
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
if (arg2>18*FONT_HEIGHT)
Fs->win_inhibit=WIG_USER_TASK_DFT;
else
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER
-WIF_FOCUS_TASK_MENU-WIF_SELF_CTRLS;
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
PsmDownKey(arg1,arg2);
PsmLeftClick(arg1,arg2);
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
PsmUpKey(arg1,arg2);
break;
default:
@ -781,7 +781,7 @@ mo_got_msg:
}
}
mo_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
PsmPopMode;

View file

@ -257,7 +257,7 @@ U0 SongTask(I64)
U0 Span()
{
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
MyMass *tmpm1=NULL,*tmpm2=NULL;
MySpring *tmps;
CCtrl *bt_run,*bt_mode;
@ -323,11 +323,11 @@ U0 Span()
try {
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN|1<<MSG_MS_R_DOWN|
1<<MSG_MS_L_UP|1<<MSG_KEY_DOWN|1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_R_DOWN|
1<<MESSAGE_MS_L_UP|1<<MESSAGE_KEY_DOWN|1<<MESSAGE_MS_MOVE);
DCFill(dc);
switch (msg_code) {
case MSG_MS_L_DOWN:
switch (message_code) {
case MESSAGE_MS_L_DOWN:
cursor_mass=tmpm1=tmpm2=NULL;
switch (mode_bttn.state) {
case MD_MASS:
@ -354,7 +354,7 @@ U0 Span()
break;
}
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
switch (mode_bttn.state) {
case MD_CONCRETE:
case MD_STEEL:
@ -369,7 +369,7 @@ U0 Span()
}
cursor_mass=tmpm1=tmpm2=NULL;
break;
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
switch (mode_bttn.state) {
case MD_MOVE:
if (!run_bttn.state && tmpm1)
@ -384,13 +384,13 @@ U0 Span()
break;
}
break;
case MSG_MS_R_DOWN:
case MESSAGE_MS_R_DOWN:
mode_bttn.state++;
if (mode_bttn.state>=MD_MODES_NUM)
mode_bttn.state=0;
cursor_mass=tmpm1=tmpm2=NULL;
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
if (!SpanTime || !a.saved_ode) {
@ -454,7 +454,7 @@ U0 Span()
}
}
span_done: //Don't goto out of try
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
DocClear;

View file

@ -355,8 +355,8 @@ U0 PlayShip()
try {
while (main_mode_bttn.state==MMD_PLAY) {
BreakConnectors;
switch (ScanMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP)) {
case MSG_KEY_DOWN:
switch (ScanMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP)) {
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '0'...'9':
if (tS>last_noise+0.25) {
@ -380,14 +380,14 @@ U0 PlayShip()
case CH_SPACE:
if (++main_mode_bttn.state==MMD_MODES_NUM)
main_mode_bttn.state=0;
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
goto ps_done;
case CH_SHIFT_ESC:
case CH_ESC:
throw;
}
break;
case MSG_KEY_UP:
case MESSAGE_KEY_UP:
switch (arg1) {
case 'd':
ode->drag_v2=0.000002;
@ -454,10 +454,10 @@ U0 EditShip()
DocClear;
try {
while (main_mode_bttn.state==MMD_EDIT) {
switch (ScanMsg(&arg1,&arg2,
1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|1<<MSG_MS_R_DOWN|
1<<MSG_MS_MOVE|1<<MSG_KEY_DOWN|1<<MSG_KEY_UP)) {
case MSG_MS_L_DOWN:
switch (ScanMessage(&arg1,&arg2,
1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_L_UP|1<<MESSAGE_MS_R_DOWN|
1<<MESSAGE_MS_MOVE|1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP)) {
case MESSAGE_MS_L_DOWN:
switch (edit_mode_bttn.state) {
case EMD_MASS:
S2W(ms.pos.x,ms.pos.y,&wx,&wy);
@ -478,7 +478,7 @@ U0 EditShip()
break;
}
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
switch (edit_mode_bttn.state) {
case EMD_MASS:
break;
@ -502,7 +502,7 @@ U0 EditShip()
break;
}
break;
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
switch (edit_mode_bttn.state) {
case EMD_MOVE:
S2W(ms.pos.x,ms.pos.y,&wx,&wy);
@ -515,13 +515,13 @@ U0 EditShip()
break;
}
break;
case MSG_MS_R_DOWN:
case MESSAGE_MS_R_DOWN:
if (++edit_mode_bttn.state==EMD_MODES_NUM)
edit_mode_bttn.state=0;
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
CleanUp;
@ -562,14 +562,14 @@ U0 EditShip()
case CH_SPACE:
if (++main_mode_bttn.state==MMD_MODES_NUM)
main_mode_bttn.state=0;
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
goto es_done;
case CH_SHIFT_ESC:
case CH_ESC:
throw;
}
break;
case MSG_KEY_UP:
case MESSAGE_KEY_UP:
switch (arg1) {
case 'd':
ODEPause(ode);

View file

@ -772,7 +772,7 @@ U0 MenFight(I64 phase_group)
U0 Titanium()
{
I64 i,msg_code,ch,sc;
I64 i,message_code,ch,sc;
Bool gun_on;
I64 next_update_jiffy;
@ -818,9 +818,9 @@ U0 Titanium()
try {
while (TRUE) {
next_update_jiffy=cnts.jiffies+JIFFY_FREQ/100;
while (msg_code=ScanMsg(&ch,&sc,1<<MSG_KEY_DOWN+1<<MSG_KEY_UP)) {
switch (msg_code) {
case MSG_KEY_DOWN:
while (message_code=ScanMessage(&ch,&sc,1<<MESSAGE_KEY_DOWN+1<<MESSAGE_KEY_UP)) {
switch (message_code) {
case MESSAGE_KEY_DOWN:
switch (ch) {
case 0:
switch (sc.u8[0]) {
@ -845,7 +845,7 @@ U0 Titanium()
break;
}
break;
case MSG_KEY_UP:
case MESSAGE_KEY_UP:
if (ch==CH_SPACE)
gun_on=FALSE;
else if (sc.u8[0]==SC_CURSOR_RIGHT||sc.u8[0]==SC_CURSOR_LEFT)
@ -927,7 +927,7 @@ U0 Titanium()
if (game_over) {
tf=tS;
Sleep(750);
FlushMsgs;
FlushMessages;
while (!ScanKey(&ch)&&friendly_left||tS-tf<1.5) {
total_score+=250;
Snd(86); Sleep(150);
@ -945,7 +945,7 @@ U0 Titanium()
}
}
to_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
}
catch
PutExcept;

View file

@ -1,7 +1,7 @@
U0 PlayerIndirect()
{
Unit *tmpu=NULL;
I64 i,remaining=0,msg_code,arg1,arg2;
I64 i,remaining=0,message_code,arg1,arg2;
F64 target_x,target_y;
ViewPlayerSet(cur_player);
for (i=0;i<UNITS_NUM;i++) {
@ -12,13 +12,13 @@ U0 PlayerIndirect()
while (remaining) {
if (!alive_cnt[0] || !alive_cnt[1])
throw('GameOver',TRUE);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_KEY_DOWN:
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_L_UP|
1<<MESSAGE_MS_R_UP);
switch (message_code) {
case MESSAGE_KEY_DOWN:
CharDo(arg1);
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
@ -33,7 +33,7 @@ U0 PlayerIndirect()
}
}
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
@ -53,7 +53,7 @@ U0 PlayerIndirect()
tmpu=NULL;
fire_radius=0;
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
if (CursorInWin(Fs,arg1,arg2))
throw('PhaseOvr',TRUE);
break;
@ -65,18 +65,18 @@ U0 PlayerIndirect()
U0 PlayerMove()
{
Unit *tmpu=NULL;
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
ViewPlayerSet(cur_player);
while (TRUE) {
if (!alive_cnt[0] || !alive_cnt[1])
throw('GameOver',TRUE);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_KEY_DOWN:
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_L_UP|
1<<MESSAGE_MS_R_UP);
switch (message_code) {
case MESSAGE_KEY_DOWN:
CharDo(arg1);
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
@ -86,7 +86,7 @@ U0 PlayerMove()
}
}
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
@ -99,7 +99,7 @@ U0 PlayerMove()
}
tmpu=NULL;
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
if (CursorInWin(Fs,arg1,arg2))
throw('PhaseOvr',TRUE);
break;
@ -110,18 +110,18 @@ U0 PlayerMove()
U0 PlayerDirect()
{
Unit *tmpu=NULL,*target;
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
ViewPlayerSet(cur_player);
while (TRUE) {
if (!alive_cnt[0] || !alive_cnt[1])
throw('GameOver',TRUE);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_KEY_DOWN:
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_L_UP|
1<<MESSAGE_MS_R_UP);
switch (message_code) {
case MESSAGE_KEY_DOWN:
CharDo(arg1);
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
@ -138,7 +138,7 @@ U0 PlayerDirect()
}
}
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
if (CursorInWin(Fs,arg1,arg2)) {
arg1-=x0; arg2-=y0;
CursorUpdate(Fs,arg1,arg2);
@ -157,7 +157,7 @@ U0 PlayerDirect()
tmpu=NULL;
fire_radius=0;
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
if (CursorInWin(Fs,arg1,arg2))
throw('PhaseOvr',TRUE);
break;

Binary file not shown.

View file

@ -41,8 +41,8 @@ Bool roads[map_rows][map_cols],
F64 fire_radius,fire_radius_x,fire_radius_y;
//These display "phase", "turn" and "game over".
U8 msg_buf[STR_LEN];
I64 msg_off_timeout; //Jiffies. Goes away after a time.
U8 message_buf[STR_LEN];
I64 message_off_timeout; //Jiffies. Goes away after a time.
//Unit types
#define UT_INFANTRY 0

View file

@ -357,8 +357,8 @@ U0 Init()
fire_radius=0;
show_vis_row=-1;
show_vis_col=-1;
*msg_buf=0;
msg_off_timeout=0;
*message_buf=0;
message_off_timeout=0;
phase=PHASE_END;
}

View file

@ -14,10 +14,10 @@ U0 TurnNew()
phase=PHASE_START;
moving_unit=NULL;
SleepUntil(msg_off_timeout);
msg_off_timeout=cnts.jiffies+JIFFY_FREQ*2*animation_delay+1;
SleepUntil(message_off_timeout);
message_off_timeout=cnts.jiffies+JIFFY_FREQ*2*animation_delay+1;
Snd(74);
StrPrint(msg_buf,"Turn %d",++turn);
StrPrint(message_buf,"Turn %d",++turn);
VRSetUp(0);
VRSetUp(1);
VisRecalc(VR_ALL_UNITS);
@ -34,21 +34,21 @@ U0 PhaseNew()
TurnNew;
}
SleepUntil(msg_off_timeout);
msg_off_timeout=cnts.jiffies+JIFFY_FREQ*2*animation_delay+1;
SleepUntil(message_off_timeout);
message_off_timeout=cnts.jiffies+JIFFY_FREQ*2*animation_delay+1;
Snd(74);
switch (phase) {
case PHASE_INDIRECT0:
case PHASE_INDIRECT1:
StrPrint(msg_buf,"Player %d Artillery Plot",cur_player+1);
StrPrint(message_buf,"Player %d Artillery Plot",cur_player+1);
break;
case PHASE_MOVE0:
case PHASE_MOVE1:
StrPrint(msg_buf,"Player %d Move",cur_player+1);
StrPrint(message_buf,"Player %d Move",cur_player+1);
break;
case PHASE_DIRECT0:
case PHASE_DIRECT1:
StrPrint(msg_buf,"Player %d Fire",cur_player+1);
StrPrint(message_buf,"Player %d Fire",cur_player+1);
break;
}
}
@ -179,8 +179,8 @@ U0 ToTheFront()
res=PhaseDo;
if (res=='GameOver') {
while (TRUE) {
msg_off_timeout=0;
StrCpy(msg_buf,"Game Over");
message_off_timeout=0;
StrCpy(message_buf,"Game Over");
Snd;
ch=GetChar(,FALSE);
if (ch=='\n') {

View file

@ -1,8 +1,8 @@
#define XMSGF_ANTISPIN 0
#define XMSGF_SOLAR_STORM 1
#define XMESSAGEF_ANTISPIN 0
#define XMESSAGEF_SOLAR_STORM 1
RegDft("ZenithOS/XCaliber",
"I64 best_score=0;\n"
"I64 msg_flags=0;\n"
"I64 message_flags=0;\n"
);
RegExe("ZenithOS/XCaliber");
@ -87,7 +87,7 @@ Bool alarm;
#define CMD_THRUST 3
#define CMD_FIRE 4
#define CMD_EXIT 5
Bool game_over,show_level_msg;
Bool game_over,show_level_message;
#define STARS_NUM 100
I64 stars_x[STARS_NUM],stars_y[STARS_NUM];
@ -465,7 +465,7 @@ U0 DrawIt(CTask *task,CDC *dc)
if (Blink)
GrPrint(dc,(task->pix_width-9*FONT_WIDTH)/2,
(task->pix_height-FONT_HEIGHT)/2,"Game Over");
} else if (show_level_msg) {
} else if (show_level_message) {
if (Blink)
GrPrint(dc,(task->pix_width-8*FONT_WIDTH)/2,
(task->pix_height-FONT_HEIGHT)/2+50,"Level %d",level);
@ -1307,16 +1307,16 @@ U0 InitLevel()
tmpm=tmpm1;
}
if (level==1)
OneTimePopUp(&msg_flags,XMSGF_SOLAR_STORM,
OneTimePopUp(&message_flags,XMESSAGEF_SOLAR_STORM,
"Face away from Sun in solar storm.\n");
if (level==4)
OneTimePopUp(&msg_flags,XMSGF_ANTISPIN,
OneTimePopUp(&message_flags,XMESSAGEF_ANTISPIN,
"Press $$GREEN$$<CURSOR-DOWN>$$FG$$ for anti-spin stabilizer.\n");
human=ShipNew(Fs->pix_width/2,Fs->pix_height/2,ST_HUMAN1);
for (i=0;i<level+2;i++)
PlaceShip(ST_ENEMY1);
PlaceShip(ST_ENEMY2);
show_level_msg=TRUE;
show_level_message=TRUE;
ODEPause(ode);
}
@ -1346,7 +1346,7 @@ U0 Init()
//********************************** Main
U0 XCaliber()
{
I64 ch,msg_code,arg1,arg2,sc;
I64 ch,message_code,arg1,arg2,sc;
CCtrl *cp=CtrlPanelNew;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
@ -1393,10 +1393,10 @@ U0 XCaliber()
QueueInsert(ode,Fs->last_ode);
ch=0;
do {
while (!game_over && !show_level_msg &&
(msg_code=ScanMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP))) {
switch (msg_code) {
case MSG_KEY_DOWN:
while (!game_over && !show_level_message &&
(message_code=ScanMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP))) {
switch (message_code) {
case MESSAGE_KEY_DOWN:
ch=arg1; sc=arg2;
switch (ch) {
case 0:
@ -1450,7 +1450,7 @@ U0 XCaliber()
break;
}
break;
case MSG_KEY_UP:
case MESSAGE_KEY_UP:
ch=arg1; sc=arg2;
switch (ch) {
case 0:
@ -1487,13 +1487,13 @@ U0 XCaliber()
ExpireSplats;
ExpireMissiles;
CheckDamage;
Refresh; //msgs are only qued by winmgr
if (show_level_msg) {
Refresh; //messages are only qued by winmgr
if (show_level_message) {
ch=GetKey(&sc);
if (ch=='\n')
ch=0;
ODEPause(ode,OFF);
show_level_msg=FALSE;
show_level_message=FALSE;
} else if (game_over) {
ch=ScanChar;
} else {
@ -1512,7 +1512,7 @@ U0 XCaliber()
MenuPop;
RegWrite("ZenithOS/XCaliber",
"I64 best_score=%d;\n"
"I64 msg_flags=%d;\n",best_score,msg_flags);
"I64 message_flags=%d;\n",best_score,message_flags);
}
ž
ÿÿÿÿÿÿÿÿ

View file

@ -63,7 +63,7 @@ U0 LexPutPos(CCompCtrl *cc)
}
U0 LexWarn(CCompCtrl *cc,U8 *str=NULL)
{//Print warn msg, then, $LK,"LexPutPos",A="MN:LexPutPos"$().
{//Print warn message, then, $LK,"LexPutPos",A="MN:LexPutPos"$().
if (str) PrintWarn(str);
if (cc->htc.fun) {
"in fun '%s'.\n",cc->htc.fun->str;
@ -79,7 +79,7 @@ U0 LexWarn(CCompCtrl *cc,U8 *str=NULL)
}
U0 LexExcept(CCompCtrl *cc,U8 *str=NULL)
{//Print err msg, $LK,"LexPutPos",A="MN:LexPutPos"$() and throw exception.
{//Print err message, $LK,"LexPutPos",A="MN:LexPutPos"$() and throw exception.
if (!Bt(&sys_run_level,RLf_ZENITH_SERVER)) {
Raw(ON);
"Note: Still in boot phase.\n";
@ -89,7 +89,7 @@ U0 LexExcept(CCompCtrl *cc,U8 *str=NULL)
ZenithErr("Task:%08X %s\n",Fs,str);
LexPutPos(cc);
cc->error_cnt++;
FlushMsgs;
FlushMessages;
if (!Bt(&sys_run_level,RLf_ZENITH_SERVER))
Debug("Type \"Fix;\"");
throw('Compiler');

Binary file not shown.

File diff suppressed because one or more lines are too long

View file

@ -1252,7 +1252,7 @@ args.
case IC_ASM:
break;
default:
"Pass:%d Missing IC hndlr\n",cc->pass;
"Pass:%d Missing IC handler\n",cc->pass;
ICPut(cc,tmpi);
LexExcept(cc,"Compiler Optimization Error at ");
}

View file

@ -504,7 +504,7 @@ here1:
case IC_LABEL:
break;
default:
"Pass:%d Missing IC hndlr\n",cc->pass;
"Pass:%d Missing IC handler\n",cc->pass;
ICPut(cc,tmpi);
LexExcept(cc,"Compiler Optimization Error at ");
}

View file

@ -669,7 +669,7 @@ p4_sib:
case IC_CALL_END2:
break;
default:
"Pass:%d Missing IC hndlr\n",cc->pass;
"Pass:%d Missing IC handler\n",cc->pass;
ICPut(cc,tmpi);
LexExcept(cc,"Compiler Optimization Error at ");
}

View file

@ -1038,7 +1038,7 @@ cc->pass==10 is final pass, code is placed into buf.
case IC_ADD_RSP1:
break;
default:
"Pass:%d Missing IC hndlr\n",cc->pass;
"Pass:%d Missing IC handler\n",cc->pass;
ICPut(cc,tmpi);
LexExcept(cc,"Compiler Optimization Error at ");
}

View file

@ -63,7 +63,7 @@ Bool MyPutKey(I64 ch,I64 sc)
//You can customize keys. This routine
//is called before the main editor
//key hndlr $LK,"DocPutKey",A="MN:DocPutKey"$().
//key handler $LK,"DocPutKey",A="MN:DocPutKey"$().
//You can intercept any key.
//Return TRUE if you completely

View file

@ -130,7 +130,7 @@ $FG,5$$TX+CX,"TODO? Meh"$$FG$
* $LK,"::/Zenith/DolDoc/DocHighlight.HC"$ for code comments at top of documents.
* Unhandled exception msgs from MP's get overwritten by WinMgr.
* Unhandled exception messages from MP's get overwritten by WinMgr.
* $LK,"Diff",A="MN:Diff"$("C:/Misc/Bible.TXT","D:/Misc/Bible.TXT"); Takes too long.
@ -255,7 +255,7 @@ $FG,5$$TX+CX,"Committee Needed"$$FG$
* Should we get rid of drive mapping. It's ugly.
* Can we get rid of $LK,"MSG_CMD",A="MN:MSG_CMD"$?
* Can we get rid of $LK,"MESSAGE_CMD",A="MN:MESSAGE_CMD"$?
* Make so just CdRom; command to copy entire disk to ::/CdRom directory?
@ -283,9 +283,9 @@ $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,"PostMsg",A="MN:PostMsg"$() msgs 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 ms_hard. Already works for $LK,"MsSet",A="MN:MsSet"$()?
* Should Msgs in PopUp queue get fwded to parent when task dies?
* Should Messages in PopUp queue get fwded to parent when task dies?
* Import Intel datasheets so we can use links in $LK,"Code",A="FI:::/Kernel/Mem/PageTables.HC"$ for documentation. I tried a PDF-to-text convertor and it wasn't acceptible.

View file

@ -1,6 +1,6 @@
$TR-UL,"Zenith"$
$ID,2$$TR,"SysMsgFlags"$
$ID,2$sys_msg_flags[0]=0xFF;
$ID,2$$TR,"SysMessageFlags"$
$ID,2$sys_message_flags[0]=0xFF;
$ID,-2$$TR,"SysRegVer"$
$ID,2$registry_version=5.030;
$ID,-2$$TR,"InsReg"$
@ -51,7 +51,7 @@ $ID,2$progress1_tf=0.000;progress2_tf=0.000;
progress3_tf=0.000;progress4_tf=226.523;
$ID,-2$$TR,"XCaliber"$
$ID,2$I64 best_score=90;
I64 msg_flags=2;
I64 message_flags=2;
$ID,-2$$TR,"Talons"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"BomberGolf"$

View file

@ -13,7 +13,7 @@ asm {
//Opcodes are slightly different to make writing my x86_64 assembler easier.
//See $LK,"::/Compiler/OpCodes.DD"$.
JIFFIES_MSG: DU8 "Jiffies:",0;
JIFFIES_MESSAGE: DU8 "Jiffies:",0;
//See $LK,"::/Kernel/StrA.HC",A="FL:::/Kernel/StrA.HC,1"$ and $LK,"::/Kernel/KUtils.HC"$.
@ -35,7 +35,7 @@ _BEEPS2::
LOOP @@05
PUSH RSI //See $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ & $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$
MOV RSI,JIFFIES_MSG
MOV RSI,JIFFIES_MESSAGE
CALL PUT_STR
POP RSI

View file

@ -23,7 +23,7 @@ asm {
//Opcodes are slightly different to make writing my x86_64 assembler easier.
//See $LK,"::/Compiler/OpCodes.DD"$.
MY_WORLD_MSG:
MY_WORLD_MESSAGE:
//Define U8 does not put terminating zeros
//on strings.
DU8 "World\n",0;
@ -40,7 +40,7 @@ _HELLO_WORLD::
MOV RAX,'Hello ' //Supports multi-byte char consts
CALL PUT_CHARS
//We broke it in two pieces to show different ways.
MOV RSI,MY_WORLD_MSG
MOV RSI,MY_WORLD_MESSAGE
CALL PUT_STR
LOOP @@05
POP RSI

View file

@ -23,7 +23,7 @@ U0 D2()
D1;
if (Prompt(4)) throw('Point4');
} catch {
"D2 hndlr\n"
"D2 handler\n"
"Ch:%c:%P\n",Fs->except_ch,Fs->except_callers[0];
if (Fs->except_ch=='Point1') {
"Caught in D2\n";
@ -38,7 +38,7 @@ U0 Demo()
D2;
if (Prompt(3)) throw('Point3');
} catch {
"Demo hndlr\n"
"Demo handler\n"
"Ch:%c:%P\n",Fs->except_ch,Fs->except_callers[0];
Fs->catch_except=TRUE;
}

Binary file not shown.

View file

@ -35,7 +35,7 @@ Bool CTPlot(CDC *dc,I64 x,I64 y,I64)
U0 CircleTrace()
{
I64 msg_code,arg1,arg2,x1,y1;
I64 message_code,arg1,arg2,x1,y1;
F64 rad,t0,total_distance;
CDC *dc=DCAlias;
@ -57,12 +57,12 @@ U0 CircleTrace()
dc->color=ROP_XOR+BLACK^TRANSPARENT;
GrCircle(dc,cx,cy,CIRCLE_RADIUS);
do {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN);
switch (msg_code) {
case MSG_KEY_UP:
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN);
switch (message_code) {
case MESSAGE_KEY_UP:
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
DCFill;
dc->color=ROP_XOR+BLACK^TRANSPARENT;
GrCircle(dc,cx,cy,CIRCLE_RADIUS);
@ -72,12 +72,12 @@ U0 CircleTrace()
total_error=0;
x1=arg1; y1=arg2;
do {
msg_code=ScanMsg(&arg1,&arg2,
1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
switch (msg_code) {
case MSG_MS_L_UP:
message_code=ScanMessage(&arg1,&arg2,
1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
switch (message_code) {
case MESSAGE_MS_L_UP:
break;
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
if (x1!=arg1 || y1!=arg2) {
total_distance+=Sqrt(Sqr(x1-arg1)+Sqr(y1-arg2));
Line(dc,x1,y1,0,arg1,arg2,0,&CTPlot);
@ -96,11 +96,11 @@ U0 CircleTrace()
//$LK,"Sleep",A="MN:Sleep"$()s until the next time the
//window mgr task runs.The
//window mgr calls the UpdateWin() routine
//and places msgs in the que, so there's
//and places messages in the que, so there's
//no need to do anything until the window mgr runs.
Refresh;
} while (msg_code!=MSG_MS_L_UP);
} while (message_code!=MESSAGE_MS_L_UP);
music.mute=TRUE; Sleep(200);
if (total_distance>0.95*CIRCUMFERENCE) {
if (score<best_score) {
@ -117,8 +117,8 @@ U0 CircleTrace()
Snd; Sleep(200); music.mute=FALSE;
break;
}
} while (msg_code!=MSG_KEY_DOWN || arg1!=CH_SHIFT_ESC && arg1!=CH_ESC);
GetMsg(,,1<<MSG_KEY_UP);
} while (message_code!=MESSAGE_KEY_DOWN || arg1!=CH_SHIFT_ESC && arg1!=CH_ESC);
GetMessage(,,1<<MESSAGE_KEY_UP);
SettingsPop;
DCFill;
DCDel(dc);

View file

@ -345,8 +345,8 @@ U0 DunGen()
try {
while (TRUE) {
switch (GetMsg(&ch,&sc,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP)) {
case MSG_KEY_DOWN:
switch (GetMessage(&ch,&sc,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP)) {
case MESSAGE_KEY_DOWN:
switch (ch) {
case '\n':
Init;
@ -426,14 +426,14 @@ U0 DunGen()
}
}
break;
case MSG_KEY_UP:
case MESSAGE_KEY_UP:
if (ch==CH_SPACE)
man_attack=FALSE;
break;
}
}
dg_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

Binary file not shown.

View file

@ -811,9 +811,9 @@ U0 FlatTops()
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
try {
while (TRUE)
switch (GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN|1<<MSG_MS_L_UP|1<<MSG_MS_R_UP|1<<MSG_MS_R_D_UP)) {
case MSG_KEY_DOWN:
switch (GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN|1<<MESSAGE_MS_L_UP|1<<MESSAGE_MS_R_UP|1<<MESSAGE_MS_R_D_UP)) {
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
CleanUp;
@ -830,18 +830,18 @@ U0 FlatTops()
break;
}
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
SquadronSeté(0,arg1,arg2);
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
SquadronLaunch(0,arg1,arg2);
break;
case MSG_MS_R_D_UP:
case MESSAGE_MS_R_D_UP:
SquadronReturn(0,arg1,arg2);
break;
}
nv_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

View file

@ -100,8 +100,8 @@ U0 Halogen()
Fs->draw_it=&DrawIt;
try {
while (TRUE) {
switch (ScanMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_KEY_UP)) {
case MSG_KEY_DOWN:
switch (ScanMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_KEY_UP)) {
case MESSAGE_KEY_DOWN:
ch=arg1;sc=arg2;
switch (ch) {
case '\n':
@ -112,7 +112,7 @@ U0 Halogen()
goto ha_done;
}
break;
case MSG_KEY_UP:
case MESSAGE_KEY_UP:
ch=arg1;sc=arg2;
if (!ch)
switch (sc.u8[0]) {
@ -151,7 +151,7 @@ U0 Halogen()
Sleep(10);
}
ha_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
MenuPop;

View file

@ -98,7 +98,7 @@ U0 CleanUp()
U0 MassSpringDemo()
{
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
MyMass *tmpm1=NULL,*tmpm2=NULL;
PopUpOk("Left-Click to place mas\n"
@ -129,22 +129,22 @@ U0 MassSpringDemo()
try {
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_MS_L_DOWN|1<<MSG_MS_R_DOWN|1<<MSG_MS_R_UP|1<<MSG_KEY_DOWN);
switch (msg_code) {
case MSG_MS_L_DOWN:
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_R_DOWN|1<<MESSAGE_MS_R_UP|1<<MESSAGE_KEY_DOWN);
switch (message_code) {
case MESSAGE_MS_L_DOWN:
PlaceMass(arg1,arg2);
break;
case MSG_MS_R_DOWN:
case MESSAGE_MS_R_DOWN:
tmpm1=MassFind(ode,arg1,arg2);
tmpm2=NULL;
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
if (tmpm1 && (tmpm2=MassFind(ode,arg1,arg2)) && tmpm1!=tmpm2)
PlaceSpring(tmpm1,tmpm2);
tmpm1=tmpm2=NULL;
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
CleanUp;
@ -158,7 +158,7 @@ U0 MassSpringDemo()
}
}
ms_done: //Don't goto out of try
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

View file

@ -528,7 +528,7 @@ U0 CleanUp()
U0 RawHide()
{
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
MenuPush(
"File {"
@ -559,14 +559,14 @@ U0 RawHide()
Fs->draw_it=&DrawIt;
try {
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+1<<MSG_MS_R_DOWN);
switch (msg_code) {
case MSG_MS_L_DOWN: //Doesn't do anything, yet.
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+1<<MESSAGE_MS_R_DOWN);
switch (message_code) {
case MESSAGE_MS_L_DOWN: //Doesn't do anything, yet.
break;
case MSG_MS_R_DOWN: //Doesn't do anything, yet.
case MESSAGE_MS_R_DOWN: //Doesn't do anything, yet.
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
ReInit;
@ -579,7 +579,7 @@ U0 RawHide()
}
}
rh_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

Binary file not shown.

Binary file not shown.

View file

@ -283,7 +283,7 @@ U0 CleanUp()
U0 TreeCheckers()
{
I64 msg_code,arg1,arg2,ch,sc;
I64 message_code,arg1,arg2,ch,sc;
Unit *tmpu;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
@ -311,10 +311,10 @@ cn_start:
show_start=FALSE;
Fs->draw_it=&DrawIt;
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
switch (msg_code) {
case MSG_KEY_DOWN:
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
switch (message_code) {
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
CleanUp;
@ -324,7 +324,7 @@ cn_start:
goto cn_done;
}
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
if (num_alive[0]>1 && num_alive[1]>1) {
tmpu=UnitFind(arg1,arg2,cur_player);
end_x=start_x=tmpu->x;
@ -332,11 +332,11 @@ cn_start:
show_start=TRUE;
}
break;
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
if (tmpu)
UnitMove(tmpu,arg1,arg2);
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
UnitMove(tmpu,arg1,arg2);
KillsCheck(tmpu->x,tmpu->y,cur_player);
show_start=FALSE;
@ -346,7 +346,7 @@ cn_start:
}
}
cn_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

Binary file not shown.

View file

@ -3,7 +3,7 @@
U0 BSplineDemo()
{
CDC *dc=DCAlias;
I64 arg1,arg2,i=0,msg_code;
I64 arg1,arg2,i=0,message_code;
CD3I32 c[PTS_NUM];
SettingsPush;
@ -13,14 +13,14 @@ U0 BSplineDemo()
"Sel ctrl points with left mouse.Right when finished.\n";
DCFill;
do {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_R_UP);
if (msg_code==MSG_MS_L_UP) {
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_R_UP);
if (message_code==MESSAGE_MS_L_UP) {
c[i].x=arg1; c[i].y=arg2; c[i].z=0;
dc->color=GREEN;
GrCircle(dc,arg1,arg2,10);
i++;
}
} while (i<PTS_NUM && msg_code!=MSG_MS_R_UP);
} while (i<PTS_NUM && message_code!=MESSAGE_MS_R_UP);
dc->color=RED;
Gr2BSpline(dc,c,i,TRUE);
dc->color=BLUE;

View file

@ -2,7 +2,7 @@
U0 Doodle()
{
I64 msg_code,i,x1,y1,x2,y2,arg1,arg2,color=BLACK;
I64 message_code,i,x1,y1,x2,y2,arg1,arg2,color=BLACK;
CDC *dc=DCAlias;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
@ -14,31 +14,31 @@ U0 Doodle()
DocClear;
DCFill;
do {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_MS_R_UP:
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+1<<MESSAGE_MS_R_UP);
switch (message_code) {
case MESSAGE_MS_R_UP:
i=PopUpColor;
if (i>=0) color=i;
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
x1=arg1; y1=arg2;
x2=arg1; y2=arg2;
dc->color=ROP_XOR+color^TRANSPARENT;
dc->thick=7;
do {
GrLine3(dc,x1,y1,0,x2,y2,0);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
GrLine3(dc,x1,y1,0,x2,y2,0);
x2=arg1; y2=arg2;
} while (msg_code!=MSG_MS_L_UP);
} while (message_code!=MESSAGE_MS_L_UP);
GrLine3(dc,x1,y1,0,x2,y2,0);
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
break;
}
} while (msg_code!=MSG_KEY_DOWN || !arg1);
GetMsg(,,1<<MSG_KEY_UP);
} while (message_code!=MESSAGE_KEY_DOWN || !arg1);
GetMessage(,,1<<MESSAGE_KEY_UP);
DCFill;
DCDel(dc);
SettingsPop;

View file

@ -74,7 +74,7 @@ U0 FESave(Bool pmt)
U0 FontEd()
{
I64 msg_code,arg1,arg2,k;
I64 message_code,arg1,arg2,k;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
MenuPush(
"File {"
@ -90,9 +90,9 @@ U0 FontEd()
try {
Fs->draw_it=&DrawIt;
while (TRUE) {
switch (msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_R_DOWN|1<<MSG_MS_MOVE)) {
case MSG_KEY_DOWN:
switch (message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN|1<<MESSAGE_MS_L_DOWN|1<<MESSAGE_MS_R_DOWN|1<<MESSAGE_MS_MOVE)) {
case MESSAGE_KEY_DOWN:
switch (arg1) {
case 0:
switch (arg2.u8[0]) {
@ -123,26 +123,26 @@ U0 FontEd()
cur_ch=arg1;
}
break;
case MSG_MS_L_DOWN:
case MSG_MS_R_DOWN:
case MESSAGE_MS_L_DOWN:
case MESSAGE_MS_R_DOWN:
if (0<=arg1<FONT_WIDTH*16 && 0<=arg2-2*FONT_HEIGHT<FONT_HEIGHT*16) {
cur_ch=(arg2/FONT_HEIGHT-2)*16+arg1/FONT_WIDTH;
break;
} //fall through
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
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||msg_code==MSG_MS_L_DOWN)
if (ms.lb||message_code==MESSAGE_MS_L_DOWN)
Bts(&text.font[cur_ch],k);
if (ms.rb||msg_code==MSG_MS_R_DOWN)
if (ms.rb||message_code==MESSAGE_MS_R_DOWN)
Btr(&text.font[cur_ch],k);
}
break;
}
}
fe_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
MenuPop;

View file

@ -181,26 +181,26 @@ U0 Lattice()
Fs->draw_it=&DrawIt;
try {
while (TRUE) {
switch (GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|
1<<MSG_MS_R_DOWN|1<<MSG_MS_R_UP|1<<MSG_MS_MOVE)) {
case MSG_MS_L_DOWN:
switch (GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN|1<<MESSAGE_MS_L_DOWN|
1<<MESSAGE_MS_R_DOWN|1<<MESSAGE_MS_R_UP|1<<MESSAGE_MS_MOVE)) {
case MESSAGE_MS_L_DOWN:
tt.first=TRUE;
tt.x=arg1;
tt.y=arg2;
break;
case MSG_MS_R_DOWN:
case MESSAGE_MS_R_DOWN:
aim=TRUE;
tt.é=Arg(arg1-tt.x,arg2-tt.y);
break;
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
if (aim)
tt.é=Arg(arg1-tt.x,arg2-tt.y);
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
tt.é=Arg(arg1-tt.x,arg2-tt.y);
aim=FALSE;
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
switch (arg1) {
case 0:
switch (arg2.u8[0]) {
@ -254,7 +254,7 @@ U0 Lattice()
}
}
lt_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

View file

@ -48,7 +48,7 @@ start_over:
public U0 Life()
{
I64 msg_code,cnt,x1,y1,x2,y2,arg1,arg2;
I64 message_code,cnt,x1,y1,x2,y2,arg1,arg2;
dc[0]=DCNew(GR_WIDTH,GR_HEIGHT);
dc[1]=DCNew(GR_WIDTH,GR_HEIGHT);
@ -66,29 +66,29 @@ public U0 Life()
Fs->draw_it=&DrawIt;
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_BORDER;
do {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN);
switch (msg_code) {
case MSG_MS_L_DOWN:
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN);
switch (message_code) {
case MESSAGE_MS_L_DOWN:
x1=arg1; y1=arg2;
x2=arg1; y2=arg2;
cnt=0;
while (msg_code!=MSG_MS_L_UP) {
while (message_code!=MESSAGE_MS_L_UP) {
restart=TRUE;
dc[cur_dc]->color=GREEN;
dc[cur_dc]->thick=0.04*ms.speed;
GrLine3(dc[cur_dc],x1,y1,0,x2,y2,0);
restart=TRUE;
msg_code=GetMsg(&arg1,&arg2,1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
x1=x2; y1=y2;
x2=arg1; y2=arg2;
}
GrLine3(dc[cur_dc],x1,y1,0,x2,y2,0);
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
break;
}
} while (msg_code!=MSG_KEY_DOWN || !arg1);
GetMsg(,,1<<MSG_KEY_UP);
} while (message_code!=MESSAGE_KEY_DOWN || !arg1);
GetMessage(,,1<<MESSAGE_KEY_UP);
SettingsPop;
DCFill;
DCDel(dc[0]);

View file

@ -452,7 +452,7 @@ U0 LTMenuSet(I64 mode)
#define PTS_NUM 1024
U0 LightTable()
{
I64 msg_code,mode=LTM_REFLECT_LINE,i,cnt,arg1,arg2,x1,y1,x2,y2;
I64 message_code,mode=LTM_REFLECT_LINE,i,cnt,arg1,arg2,x1,y1,x2,y2;
CD3I32 *c=MAlloc(PTS_NUM*sizeof(CD3I32));
p_root_locks=0;
@ -504,11 +504,11 @@ U0 LightTable()
animate_tasks[i]=Spawn(&MPAnimateTask,NULL,"MPAnimate",i);
try {
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+1<<MSG_MS_L_UP+1<<MSG_MS_R_UP);
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_R_UP);
lt_restart:
switch (msg_code) {
case MSG_MS_L_UP:
switch (message_code) {
case MESSAGE_MS_L_UP:
Sweep(100,90,100);
x2=arg1; y2=arg2;
switch (mode) {
@ -523,7 +523,7 @@ lt_restart:
break;
}
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
x1=arg1; y1=arg2;
switch (mode) {
case LTM_REFLECT_LINE:
@ -535,12 +535,12 @@ lt_restart:
while (TRUE) {
x2=arg1; y2=arg2;
GrLine(map,x1,y1,x2,y2);
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
GrLine(map,x1,y1,x2,y2);
if (msg_code==MSG_KEY_DOWN)
if (message_code==MESSAGE_KEY_DOWN)
goto lt_restart;
else if (msg_code==MSG_MS_L_UP) {
else if (message_code==MESSAGE_MS_L_UP) {
Sweep(100,90,100);
x2=arg1; y2=arg2;
break;
@ -566,16 +566,16 @@ lt_restart:
do {
c[cnt].x=arg1; c[cnt].y=arg2; c[cnt].z=0;
Gr2BSpline(map,c,cnt+1);
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN+1<<MSG_MS_L_UP+
1<<MSG_MS_MOVE+1<<MSG_MS_R_UP);
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_UP+
1<<MESSAGE_MS_MOVE+1<<MESSAGE_MS_R_UP);
Gr2BSpline(map,c,cnt+1);
if (msg_code==MSG_KEY_DOWN)
if (message_code==MESSAGE_KEY_DOWN)
goto lt_restart;
else if (msg_code==MSG_MS_L_UP) {
else if (message_code==MESSAGE_MS_L_UP) {
Sweep(100,90,100);
cnt++;
}
} while (cnt<PTS_NUM-1 && msg_code!=MSG_MS_R_UP);
} while (cnt<PTS_NUM-1 && message_code!=MESSAGE_MS_R_UP);
if (mode==LTM_REFLECT_SPLINE)
map->color=MIRROR_COLOR;
else
@ -594,7 +594,7 @@ lt_restart:
break;
}
break;
case MSG_MS_R_UP:
case MESSAGE_MS_R_UP:
i=PopUpPickLst("Reflect Line\0Reflect Spline\0Refract Line\0"
"Refract Spline\0Refract Flood Fill\0TestRay\0");
if (i>=0) {
@ -602,7 +602,7 @@ lt_restart:
LTMenuSet(mode);
}
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
switch (arg1) {
case '\n':
CleanUp;
@ -616,7 +616,7 @@ lt_restart:
case 'e':
full_speed=TRUE;
Sleep(1500);
FlushMsgs;
FlushMessages;
full_speed=FALSE;
break;
case 'n':
@ -635,7 +635,7 @@ lt_restart:
}
}
lt_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
Free(c);

Binary file not shown.

Binary file not shown.

View file

@ -94,7 +94,7 @@ U0 Draw()
U0 PoleZeros()
{
I64 msg_code,arg1,arg2,p11,p22,cx,cy;
I64 message_code,arg1,arg2,p11,p22,cx,cy;
Complex *tmpc=NULL;
PopUpOk(
@ -117,34 +117,34 @@ U0 PoleZeros()
try {
Draw;
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+
1<<MSG_MS_L_UP+1<<MSG_MS_R_DOWN+1<<MSG_MS_R_UP+1<<MSG_MS_MOVE);
pz_msg:
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+
1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_R_DOWN+1<<MESSAGE_MS_R_UP+1<<MESSAGE_MS_MOVE);
pz_message:
cx=Fs->pix_width/2;
cy=Fs->pix_height/2;
switch (msg_code) {
case MSG_MS_L_DOWN:
switch (message_code) {
case MESSAGE_MS_L_DOWN:
tmpc=PoleZeroFind(arg1-cx,cy-arg2);
break;
case MSG_MS_MOVE:
case MESSAGE_MS_MOVE:
if (tmpc) {
p11=arg1;p22=arg2;
//get to last mouse move
while (msg_code=ScanMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+
1<<MSG_MS_L_UP+1<<MSG_MS_R_DOWN+
1<<MSG_MS_R_UP+1<<MSG_MS_MOVE))
if (msg_code==MSG_MS_MOVE) {
while (message_code=ScanMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+
1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_R_DOWN+
1<<MESSAGE_MS_R_UP+1<<MESSAGE_MS_MOVE))
if (message_code==MESSAGE_MS_MOVE) {
p11=arg1;p22=arg2;
} else
goto pz_msg;
goto pz_message;
tmpc->x=p11-cx;
tmpc->y=cy-p22;
Draw;
}
break;
case MSG_MS_L_UP:
case MESSAGE_MS_L_UP:
if (tmpc) {
tmpc->x=arg1-cx;
tmpc->y=cy-arg2;
@ -152,18 +152,18 @@ pz_msg:
Draw;
}
break;
case MSG_MS_R_DOWN:
case MSG_MS_R_UP:
case MESSAGE_MS_R_DOWN:
case MESSAGE_MS_R_UP:
Draw;
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
if (arg1==CH_SHIFT_ESC||arg1==CH_ESC)
goto pz_done;
}
Refresh;
}
pz_done:
GetMsg(,,1<<MSG_KEY_UP);
GetMessage(,,1<<MESSAGE_KEY_UP);
} catch
PutExcept;
SettingsPop;

View file

@ -2,7 +2,7 @@
public U0 SpeedLineDemo()
{
I64 msg_code,cnt,x1,y1,x2,y2,arg1,arg2,color=BLACK;
I64 message_code,cnt,x1,y1,x2,y2,arg1,arg2,color=BLACK;
CDC *dc=DCAlias;
dc->color=color;
@ -15,33 +15,33 @@ public U0 SpeedLineDemo()
DocClear;
DCFill;
do {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+1<<MSG_MS_R_UP);
switch (msg_code) {
case MSG_MS_R_UP:
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+1<<MESSAGE_MS_R_UP);
switch (message_code) {
case MESSAGE_MS_R_UP:
color=PopUpColor;
if (color>=0)
dc->color=color;
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
x1=arg1; y1=arg2;
x2=arg1; y2=arg2;
cnt=0;
while (msg_code!=MSG_MS_L_UP) {
while (message_code!=MESSAGE_MS_L_UP) {
dc->thick=0.04*ms.speed;
GrLine3(dc,x1,y1,0,x2,y2,0);
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
x1=x2; y1=y2;
x2=arg1; y2=arg2;
}
GrLine3(dc,x1,y1,0,x2,y2,0);
break;
case MSG_KEY_DOWN:
case MESSAGE_KEY_DOWN:
break;
}
} while (msg_code!=MSG_KEY_DOWN || !arg1);
GetMsg(,,1<<MSG_KEY_UP);
} while (message_code!=MESSAGE_KEY_DOWN || !arg1);
GetMessage(,,1<<MESSAGE_KEY_UP);
DCFill;
DCDel(dc);
SettingsPop;

View file

@ -5,7 +5,7 @@ If the line of symmetry is a point, symmetry is turned-off.
U0 SymmetryDemo()
{
I64 msg_code,x1,y1,x2,y2,arg1,arg2;
I64 message_code,x1,y1,x2,y2,arg1,arg2;
CDC *dc=DCAlias;
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
@ -18,19 +18,19 @@ U0 SymmetryDemo()
dc->flags|=DCF_SYMMETRY;
DCSymmetrySet(dc,Fs->pix_width/2,0,Fs->pix_width/2,1);
do {
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN+1<<MSG_MS_L_DOWN+
1<<MSG_MS_R_DOWN);
switch (msg_code) {
case MSG_MS_R_DOWN:
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_KEY_DOWN+1<<MESSAGE_MS_L_DOWN+
1<<MESSAGE_MS_R_DOWN);
switch (message_code) {
case MESSAGE_MS_R_DOWN:
dc->flags&=~DCF_SYMMETRY;
dc->color=ROP_XOR+RED^TRANSPARENT;
x1=arg1; y1=arg2;
x2=arg1; y2=arg2;
while (msg_code!=MSG_MS_R_UP) {
while (message_code!=MESSAGE_MS_R_UP) {
GrLine3(dc,x1,y1,0,x2,y2,0);
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_MS_R_UP+1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_MS_R_UP+1<<MESSAGE_MS_MOVE);
GrLine3(dc,x1,y1,0,x2,y2,0);
x2=arg1; y2=arg2;
}
@ -38,22 +38,22 @@ U0 SymmetryDemo()
if (DCSymmetry3Set(dc,x1,y1,0,x2,y2,0,x2,y2,1))
dc->flags|=DCF_SYMMETRY;
break;
case MSG_MS_L_DOWN:
case MESSAGE_MS_L_DOWN:
dc->color=ROP_XOR+BLACK^TRANSPARENT;
x1=arg1; y1=arg2;
x2=arg1; y2=arg2;
while (msg_code!=MSG_MS_L_UP) {
while (message_code!=MESSAGE_MS_L_UP) {
GrLine3(dc,x1,y1,0,x2,y2,0);
msg_code=GetMsg(&arg1,&arg2,
1<<MSG_MS_L_UP+1<<MSG_MS_MOVE);
message_code=GetMessage(&arg1,&arg2,
1<<MESSAGE_MS_L_UP+1<<MESSAGE_MS_MOVE);
GrLine3(dc,x1,y1,0,x2,y2,0);
x2=arg1; y2=arg2;
}
GrLine3(dc,x1,y1,0,x2,y2,0);
break;
}
} while (msg_code!=MSG_KEY_DOWN || (arg1!=CH_ESC && arg1!=CH_SHIFT_ESC));
GetMsg(,,1<<MSG_KEY_UP);
} while (message_code!=MESSAGE_KEY_DOWN || (arg1!=CH_ESC && arg1!=CH_SHIFT_ESC));
GetMessage(,,1<<MESSAGE_KEY_UP);
DCFill;
DCDel(dc);
SettingsPop;

View file

@ -13,16 +13,16 @@ U8 i;
"Ed(\"InEd.DD\");\n";
//Go to start of file
Msg(MSG_KEY_DOWN,0,SC_CURSOR_UP|SCF_CTRL);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_UP|SCF_CTRL);
for (i=0;i<=0xC3;i++) {
if (i)
Msg(MSG_KEY_DOWN_UP,0,SC_F3);
Message(MESSAGE_KEY_DOWN_UP,0,SC_F3);
else
"%c0x%c",CH_CTRLF,CH_ESC;
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
"%02X",i;
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
"%c%c",CH_BACKSPACE,CH_BACKSPACE;
}

View file

@ -8,5 +8,5 @@ windows.
In("");
"PopUp #1:%X\n",PopUpNoYes;
InStr("Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);'' CH_SPACE;");
InStr("Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);'' CH_SPACE;");
"PopUp #2:%X\n",PopUpNoYes;

Binary file not shown.

23
src/Demo/MessageLoop.HC Executable file
View file

@ -0,0 +1,23 @@
U0 MessageLoop()
{
I64 arg1,arg2,message_code;
"Use $LK,"message_code",A="MN:MESSAGE_CMD"$ defines in your programs instead of hardcoded nums.\n"
"<ESC> to Exit\n";
//We don't want the mouse bttns to reposition the cursor,
//so we inhibit the window mgr from processing them.
Fs->win_inhibit=WIF_SELF_MS_L|WIF_SELF_MS_R;
do {
message_code=GetMessage(&arg1,&arg2,~(1<<MESSAGE_NULL));
"CMD:%02X ARG1:%08X ARG2:%016X\n",message_code,arg1,arg2;
} while (message_code!=MESSAGE_KEY_DOWN || arg1!=CH_ESC && arg1!=CH_SHIFT_ESC);
GetMessage(,,1<<MESSAGE_KEY_UP);
Fs->win_inhibit=WIG_USER_TASK_DFT;
}
MessageLoop;
// Press <CTRL-SHIFT-L> and "Insert $LK,"ASCII",A="MN:CH_CTRLA"$/$LK,"ScanCode",A="FI:::/Doc/CharOverview.DD"$".

View file

@ -1,23 +0,0 @@
U0 MsgLoop()
{
I64 arg1,arg2,msg_code;
"Use $LK,"msg_code",A="MN:MSG_CMD"$ defines in your programs instead of hardcoded nums.\n"
"<ESC> to Exit\n";
//We don't want the mouse bttns to reposition the cursor,
//so we inhibit the window mgr from processing them.
Fs->win_inhibit=WIF_SELF_MS_L|WIF_SELF_MS_R;
do {
msg_code=GetMsg(&arg1,&arg2,~(1<<MSG_NULL));
"CMD:%02X ARG1:%08X ARG2:%016X\n",msg_code,arg1,arg2;
} while (msg_code!=MSG_KEY_DOWN || arg1!=CH_ESC && arg1!=CH_SHIFT_ESC);
GetMsg(,,1<<MSG_KEY_UP);
Fs->win_inhibit=WIG_USER_TASK_DFT;
}
MsgLoop;
// Press <CTRL-SHIFT-L> and "Insert $LK,"ASCII",A="MN:CH_CTRLA"$/$LK,"ScanCode",A="FI:::/Doc/CharOverview.DD"$".

View file

@ -5,7 +5,7 @@
U0 PullDownMenuDemo()
{
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
CMenuEntry *tmpse;
MenuPush(
@ -20,8 +20,8 @@ U0 PullDownMenuDemo()
"}"
"Misc {"
" Beep(,CH_SPACE);"
" Opt1(MSG_CMD,M_OPTION1);"
" Opt2(MSG_CMD,M_OPTION2);"
" Opt1(MESSAGE_CMD,M_OPTION1);"
" Opt2(MESSAGE_CMD,M_OPTION2);"
"}"
"Help {"
" Help(,,0x3B0000003B);"
@ -33,11 +33,11 @@ U0 PullDownMenuDemo()
"of the scrn.\n\n";
do {
msg_code=GetMsg(&arg1,&arg2,1<<MSG_KEY_DOWN+1<<MSG_CMD);
"\nCmd:%d ARG1:%X ARG2:%X\n\n",msg_code,arg1,arg2;
message_code=GetMessage(&arg1,&arg2,1<<MESSAGE_KEY_DOWN+1<<MESSAGE_CMD);
"\nCmd:%d ARG1:%X ARG2:%X\n\n",message_code,arg1,arg2;
switch (msg_code) {
case MSG_KEY_DOWN:
switch (message_code) {
case MESSAGE_KEY_DOWN:
switch (arg1) {//ASCII
case CH_SPACE:
Beep;
@ -63,10 +63,10 @@ U0 PullDownMenuDemo()
}
break;
case MSG_CMD:
case MESSAGE_CMD:
//I Recommend making your menu
//drive by key strokes, but you can
//use the $LK,"MSG_CMD",A="MN:MSG_CMD"$ val.
//use the $LK,"MESSAGE_CMD",A="MN:MESSAGE_CMD"$ val.
switch (arg1) {
case M_OPTION1:
"Option # 1\n";
@ -82,7 +82,7 @@ U0 PullDownMenuDemo()
break;
}
} while (msg_code!=MSG_KEY_DOWN||(arg1!=CH_SHIFT_ESC && arg1!=CH_ESC));
} while (message_code!=MESSAGE_KEY_DOWN||(arg1!=CH_SHIFT_ESC && arg1!=CH_ESC));
MenuPop;
}

View file

@ -90,7 +90,7 @@ I64 MorseWaitKey()
F64 dt;
while (TRUE) {
if (m_start) {
GetMsg(NULL,NULL,1<<MSG_KEY_UP);
GetMessage(NULL,NULL,1<<MESSAGE_KEY_UP);
m_end=tS;
Snd;
dt_down=m_end-m_start;
@ -102,7 +102,7 @@ I64 MorseWaitKey()
return '-';
} else {
if (!space_sent) {
while (!ScanMsg(&ch,NULL,1<<MSG_KEY_DOWN)) {
while (!ScanMessage(&ch,NULL,1<<MESSAGE_KEY_DOWN)) {
dt=tS-m_end;
if (dt>=M_SPACE_THRESHOLD) {
space_sent=TRUE;

View file

@ -7,17 +7,17 @@ U0 InEdUtil(U8 *filename)
"Ed(\"%s\");\n",filename;
//Go to start of file
Msg(MSG_KEY_DOWN,0,SC_CURSOR_UP|SCF_CTRL);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_UP|SCF_CTRL);
for (i=0;i<10000;i++) {
if (i)
Msg(MSG_KEY_DOWN_UP,0,SC_F3);
Message(MESSAGE_KEY_DOWN_UP,0,SC_F3);
else
"%c0x%c",CH_CTRLF,CH_ESC;
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
"%02X",i;
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Msg(MSG_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
Message(MESSAGE_KEY_DOWN,0,SC_CURSOR_RIGHT);
"%c%c",CH_BACKSPACE,CH_BACKSPACE;
}
}

View file

@ -20,7 +20,7 @@ The upper 4-bytes are copied from lower 4-bytes.
$FG,2$Byte 4$FG$ is the code. Left, Right and NumPad keys distinct.
$FG,2$Byte 5-7$FG$ are $LK,"flags",A="MN:SCf_KEY_UP"$
Run the program $LK,"::/Demo/MsgLoop.HC"$ to examine scan code. Press $FG,2$<CTRL-SHIFT-l>$FG$ and "Insert ASCII/ScanCode".$FG$
Run the program $LK,"::/Demo/MessageLoop.HC"$ to examine scan code. Press $FG,2$<CTRL-SHIFT-l>$FG$ and "Insert ASCII/ScanCode".$FG$
See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.DD"$ and $LK,"CKbdStateGlbls",A="MN:CKbdStateGlbls"$.

View file

@ -3,4 +3,4 @@ $WW,1$* You can adjust the mouse movement rate by setting global vars in your st
* 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"$.
* Get rid of this msg $LK,"here",A="FF:~/Once.HC,Customize.DD"$.
* Get rid of this message $LK,"here",A="FF:~/Once.HC,Customize.DD"$.

View file

@ -37,6 +37,6 @@ $ID,-2$
* There is a heap check utility which can find leaks. Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$(). It's a really simple program which intercepts $LK,"MAlloc",A="MN:MAlloc"$() and $LK,"Free",A="MN:Free"$(). You can customize the code to find other heap issues.
* You can define hndlr functions for $FG,2$<CTRL-ALT-letter>$FG$ keys with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd msgs. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$<CTRL-ALT-letter>$FG$ hndlrs take a scan_code as an arg.
* You can define handler functions for $FG,2$<CTRL-ALT-letter>$FG$ keys with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd messages. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$<CTRL-ALT-letter>$FG$ handlers take a scan_code as an arg.
* If you recompile $FG,2$Kernel$FG,2$$FG$ with $LK,"BootHDIns",A="MN:BootHDIns"$(), you can set the $FG,4$MemInit$FG$, option to initialize memory to a value at boot, the $FG,4$HeapInit$FG$ option to cause mem alloced off the heap to be initialized or $FG,4$VarInit$FG$ option so both global and local vars will be initialized to a value, but global AOT variables are always zero if not initialized. Pick a non-zero value to discover uninitialized var bugs. You can set $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$, and $LK,"sys_heap_init_flag",A="MN:sys_heap_init_flag"$ directly after booting.

View file

@ -19,7 +19,7 @@ $LK,"::/Demo/Games/ElephantWalk.HC"$
$LK,"::/Demo/Graphics/SpritePut.HC"$
$LK,"::/Demo/Graphics/SpritePutExt.HC"$
$LK,"::/Demo/Snd/ASCIIOrgan.HC"$
$LK,"::/Demo/MsgLoop.HC"$
$LK,"::/Demo/MessageLoop.HC"$
$LK,"::/Demo/Graphics/Doodle.HC"$
$LK,"::/Demo/Graphics/Speedline.HC"$
$LK,"::/Demo/Graphics/Bounce.HC"$

View file

@ -149,7 +149,7 @@ The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG
$ID,-2$$TR,"MA Macro"$
$ID,2$A left macro arg, $FG,2$LM=""$FG$, will send text when the left mouse is clicked.
A left in string, $FG,2$+LIS$FG$, flag will cause text to be sent to $LK,"InStr",A="MN:InStr"$() instead of $LK,"In",A="MN:In"$(). An InStr runs code. Literal text is in quotes and messages are sent with $LK,"Msg",A="MN:Msg"$(). See $MA-X+PU,LM="Dir(\"::/Demo/InFile\");View;"$.
A left in string, $FG,2$+LIS$FG$, flag will cause text to be sent to $LK,"InStr",A="MN:InStr"$() instead of $LK,"In",A="MN:In"$(). An InStr runs code. Literal text is in quotes and messages are sent with $LK,"Message",A="MN:Message"$(). See $MA-X+PU,LM="Dir(\"::/Demo/InFile\");View;"$.
Macro's are usually in your $LK,"~/PersonalMenu.DD"$ and have the '$FG,2$+X$FG$' flag set by $LK,"default",A="MN:DocInit"$. Adding '$FG,2$-X$FG$' prevents the usual $FG,2$<ESC>$FG$ from being sent (which exits the PersonalMenu scrn). Note: When you click a macro on the cmd line, it will go to the bottom and execute unless you cancel the $FG,2$<ESC>$FG$ with a '$FG,2$-X$FG$'.
$ID,-2$$TR,"MU Menu Value"$
@ -275,7 +275,7 @@ $FG,5$EXAMPLES:
$FG$<CTRL-t> to see how the following were done.
$UL,1$Underlined$UL,0$ $IV,1$Inverted$IV,0$ $BK,1$Blinking$BK,0$ $SY,-3$super$SY,0$ $SY,0$$SY,3$sub$SY,0$
$TX,"This is a big long scrolling msg.",SCX=10$
$TX,"This is a big long scrolling message.",SCX=10$
$FG,5$Cursor Movements:$FG$
$CM+LX,LE=3,RE=3$Cursor moved 3 rows down and to 3rd column from left.

View file

@ -92,7 +92,7 @@ $FG,2$Mid$FG$ Middle
$FG,2$Mon$FG$ Month
$FG,2$MP$FG$ MultiProcessor
$FG,2$Ms$FG$ Mouse
$FG,2$Msg$FG$ Message
$FG,2$Message$FG$ Message
$FG,2$Num$FG$ Number
$FG,2$Obj$FG$ Object
$FG,2$Occ$FG$ Occurrence

View file

@ -38,14 +38,14 @@ MyPrint("Hello World\n");
--------Hello.HC---------
asm {
MSG: DU8 "Hello World\n",0;
MESSAGE: DU8 "Hello World\n",0;
//The convention is underscore on C callable.
//Two colons means exported symbol.
_HELLO_WORLD::
//You can only clobber RAX,RBX,RCX,RDX
PUSH RSI
MOV RSI,MSG
MOV RSI,MESSAGE
CALL PUT_STR
POP RSI
RET

View file

@ -227,7 +227,7 @@ $FG$$ID,-2$
* There is a keyword $FG,2$lastclass$FG$ you use as a dft arg. It is set to the class name of the prev arg. See $LK,"::/Demo/LastClass.HC"$, $LK,"ClassRep",A="MN:ClassRep"$(), $LK,"DocForm",A="MN:DocForm"$() and $LK,"::/Demo/Disk/BlkDevRep.HC"$.
* See $LK,"::/Demo/Exceptions.HC"$. $FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$ are different from C++. $FG,2$throw$FG$ is a function with an 8-byte or less char arg. The char string passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_ch$FG$. Within a $FG,2$catch {}$FG$ blk, set the var $FG,2$Fs->catch_except$FG$ to $FG,2$TRUE$FG$ if you want to terminate the search for a hndlr. Use $LK,"PutExcept",A="MN:PutExcept"$() as a hndlr, if you like.
* See $LK,"::/Demo/Exceptions.HC"$. $FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$ are different from C++. $FG,2$throw$FG$ is a function with an 8-byte or less char arg. The char string passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_ch$FG$. Within a $FG,2$catch {}$FG$ blk, set the var $FG,2$Fs->catch_except$FG$ to $FG,2$TRUE$FG$ if you want to terminate the search for a handler. Use $LK,"PutExcept",A="MN:PutExcept"$() as a handler, if you like.
* A function is available similar to $FG,2$sizeof$FG$ which provides the offset of a member of a class. It's called $FG,2$offset$FG$. You place the class name and member inside as in $FG,2$offset(classname.membername)$FG$. It has nothing to do with 16-bit code. Both $FG,2$sizeof$FG$ and $FG,2$offset$FG$ only accept one level of member vars. That is, you can't do $FG,2$sizeof(classname.membername.submembername)$FG$.$FG$

View file

@ -1,6 +1,6 @@
$WW,1$$FG,2$InFiles$FG$ are used to generate user input to automate operations. The ZenithOS tour is done with an $FG,2$InFile$FG$. It reminds me of a Unix pipe because $FG,2$StdOut$FG$ of one gets chained into $FG,2$StdIn$FG$ of another.
When an $FG,2$InFile$FG$ runs, a child task is $LK,"Spawn",A="MN:Spawn"$()ed which intercepts real user input and generates fake input. InFiles are $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ programs run by the child whose stdout goes to the parent's input buffer. $LK,"Msg",A="MN:Msg"$() can be included in an $FG,2$InFile$FG$ to send special keys or mouse cmds to the parent. While an $FG,2$InFile$FG$ is running, the normal input gets diverted to the InFile task and can be filtered and sent back to the parent task. Unless you are driving functions which prompt for data, you can probably use an $FG,2$#include$FG$ file in place of an $FG,2$InFile$FG$.
When an $FG,2$InFile$FG$ runs, a child task is $LK,"Spawn",A="MN:Spawn"$()ed which intercepts real user input and generates fake input. InFiles are $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ programs run by the child whose stdout goes to the parent's input buffer. $LK,"Message",A="MN:Message"$() can be included in an $FG,2$InFile$FG$ to send special keys or mouse cmds to the parent. While an $FG,2$InFile$FG$ is running, the normal input gets diverted to the InFile task and can be filtered and sent back to the parent task. Unless you are driving functions which prompt for data, you can probably use an $FG,2$#include$FG$ file in place of an $FG,2$InFile$FG$.
See $LK,"::/Demo/InFile/InDir.IN"$.

Binary file not shown.

View file

@ -4,11 +4,11 @@ See $LK,"Char",A="HI:Char"$ for definition of scan codes.
See $MA-X+PU,"Key Map",LM="KeyMap;View;\n"$ for a detailed list of key commands.
When you are at the cmd line, editing documents, browsing documentation and help, entering items in forms or in menu's, the $LK,"DolDoc",A="MN:CDoc"$ editor handles keys. It allows you to define your own key hndlrs in a $LK,"MyPutKey",A="MN:MyPutKey"$() function. If you choose, you can catch keys, overriding the default hndlrs. See $LK,"DocPutKey",A="MN:DocPutKey"$(). The following is an overview of key allocations.
When you are at the cmd line, editing documents, browsing documentation and help, entering items in forms or in menu's, the $LK,"DolDoc",A="MN:CDoc"$ editor handles keys. It allows you to define your own key handlers in a $LK,"MyPutKey",A="MN:MyPutKey"$() function. If you choose, you can catch keys, overriding the default handlers. See $LK,"DocPutKey",A="MN:DocPutKey"$(). The following is an overview of key allocations.
$FG,2$<ALT-keys>$FG$ and $FG,2$<ALT-SHIFT-keys>$FG$ Free for user configurations in your $LK,"MyPutKey",A="MN:MyPutKey"$() hndlr, except for $FG,2$ALT-BACKSPACE$FG$ (undo). There are a few examples pre-defined, but you can change them if you wish.
$FG,2$<ALT-keys>$FG$ and $FG,2$<ALT-SHIFT-keys>$FG$ Free for user configurations in your $LK,"MyPutKey",A="MN:MyPutKey"$() handler, except for $FG,2$ALT-BACKSPACE$FG$ (undo). There are a few examples pre-defined, but you can change them if you wish.
$FG,2$<CTRL-ALT-keys>$FG$ and $FG,2$<CTRL-ALT-SHIFT-keys>$FG$ Handled at a system level, NOT by the $LK,"CDoc",A="MN:CDoc"$ editor. I reserve the right to alloc these, but in the mean time, you can define your own hndlrs with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd msgs. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$<CTRL-ALT-letter>$FG$ hndlrs take a scan_code as an arg.
$FG,2$<CTRL-ALT-keys>$FG$ and $FG,2$<CTRL-ALT-SHIFT-keys>$FG$ Handled at a system level, NOT by the $LK,"CDoc",A="MN:CDoc"$ editor. I reserve the right to alloc these, but in the mean time, you can define your own handlers with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd messages. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$<CTRL-ALT-letter>$FG$ handlers take a scan_code as an arg.
$FG,2$<CTRL-function key>$FG$ Auto-completes local words.

View file

@ -1,14 +1,14 @@
$WW,1$The editor mostly stays in a $LK,"GetKey",A="MN:GetKey"$()/$LK,"PutKey",A="MN:PutKey"$() loop. The putkey portion is where keys are acted-upon. ZenithOS has a chain of putkey hndlrs in a $LK,"Circular Queue",A="HI:Circular Queue"$ with priorities. The highest priority hndlrs can choose to terminate handling, otherwise, the keys get sent on down the chain.
$WW,1$The editor mostly stays in a $LK,"GetKey",A="MN:GetKey"$()/$LK,"PutKey",A="MN:PutKey"$() loop. The putkey portion is where keys are acted-upon. ZenithOS has a chain of putkey handlers in a $LK,"Circular Queue",A="HI:Circular Queue"$ with priorities. The highest priority handlers can choose to terminate handling, otherwise, the keys get sent on down the chain.
$LK,"KeyDevAdd",A="MN:KeyDevAdd"$() defines a putkey device with a priority. "Device" might be a misnomer. Currently, the following are defined:
Priority Handler
---------- ---------
$FG,2$0x20000000$FG$ $LK,"MyPutKey",A="MN:MyPutKey"$() user hndlr
$FG,2$0x20000000$FG$ $LK,"MyPutKey",A="MN:MyPutKey"$() user handler
$FG,2$0x40000000$FG$ $LK,"KDInputFilterPutKey",A="MN:KDInputFilterPutKey"$() for $LK,"In",A="MN:In"$(), $LK,"InStr",A="MN:InStr"$(), and $LK,"InFile",A="MN:InFile"$() handling.
$FG,2$0x60000000$FG$ $LK,"KDRawPutKey",A="MN:KDRawPutKey"$() nonwindowed direct to video mem debug output.
$FG,2$0x80000000$FG$ $LK,"KDDocPutKey",A="MN:KDDocPutKey"$() standard document cmds
Since handling individual keys is slow, ZenithOS supports PutS() as well. If no puts hndlr is defined, individual keys are sent.
Since handling individual keys is slow, ZenithOS supports PutS() as well. If no puts handler is defined, individual keys are sent.
$LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_key$FG$ and $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_s$FG$ are call back routines which offer some neat tricks. See $LK,"::/Apps/Psalmody/JukeBox.HC"$. There is a var $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_data$FG$ which gets passed to them.

View file

@ -12,8 +12,8 @@ Edit {
Paste(,,SC_INS|SCF_SHIFT);
}
Misc {
Opt1(MSG_CMD,M_OPTION1);
Opt2(MSG_CMD,M_OPTION2);
Opt1(MESSAGE_CMD,M_OPTION1);
Opt2(MESSAGE_CMD,M_OPTION2);
}
Help
{
@ -21,7 +21,7 @@ Help
About(,'/');
}
$FG$
The first arg is the msg code and it is optional with the default being $LK,"MSG_KEY_DOWN_UP",A="MN:MSG_KEY_DOWN_UP"$. The second arg is the msg $FG,2$arg1$FG$ value which is $LK,"ASCII",A="MN:CH_CTRLA"$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$. The third arg is the msg $FG,2$arg2$FG$ value which is the $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$$FG$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$.
The first arg is the message code and it is optional with the default being $LK,"MESSAGE_KEY_DOWN_UP",A="MN:MESSAGE_KEY_DOWN_UP"$. The second arg is the message $FG,2$arg1$FG$ value which is $LK,"ASCII",A="MN:CH_CTRLA"$ of the key in the case of $LK,"MESSAGE_KEY_DOWN",A="MN:MESSAGE_KEY_DOWN"$. The third arg is the message $FG,2$arg2$FG$ value which is the $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$$FG$ of the key in the case of $LK,"MESSAGE_KEY_DOWN",A="MN:MESSAGE_KEY_DOWN"$.
Press $FG,2$<CTRL-SHIFT-l>$FG$ and "Insert ASCII/ScanCode".

View file

@ -1 +1 @@
$WW,1$There are a maximum of 63 message types, so a bitmask can be passed. Messages have two args. See $LK,"Message Codes",A="MN:MSG_NULL"$.
$WW,1$There are a maximum of 63 message types, so a bitmask can be passed. Messages have two args. See $LK,"Message Codes",A="MN:MESSAGE_NULL"$.

View file

@ -1,4 +1,4 @@
$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 msg passing. $LK,"ms.pos.z",A="MN:ms"$ is the wheel.
$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.
$LK,"ms.pos_text.x",A="MN:CMsStateGlbls"$ and $LK,"ms.pos_text.y",A="MN:CMsStateGlbls"$ are the text column and row. See $LK,"::/Demo/Games/Maze.HC"$.

View file

@ -30,7 +30,7 @@ $ID,-2$
* A $LK,"Cd",A="MN:Cd"$() cmd must be followed by two semicolons if a $FG,2$#include$FG$ is after it. This is because the preprocessor processes the next token ahead.
* The assembler's error msgs are often off by a line and undefines are cryptic.
* The assembler's error messages are often off by a line and undefines are cryptic.
* The last semicolon on the cmd line is converted to a dbl semicolon because the compiler looks ahead before doing a cmd. This normally has no negative effect, but when entering $FG,2$if$FG$ stmts with $FG,2$else$FG$ clauses it presents problems.

View file

@ -3,6 +3,7 @@ BootHDIns;
"\n\nSuccessful?";
if(YorN)
{
 Once("#include\"DoDistro\";;Del(\"~/Registry.HC\");OutU16(0x4004, 0x3400);");
Del("~/Registry.HC");
Once("#include\"DoDistro\";;OutU16(0x4004, 0x3400);");
Reboot;
}

44
src/Home/Registry.HC Executable file
View file

@ -0,0 +1,44 @@
$TR,"Zenith"$
$ID,2$$TR,"SysMessageFlags"$
$ID,2$sys_message_flags[0]=0;
$ID,-2$$TR,"SysRegVer"$
$ID,2$registry_version=0.100;
$ID,-2$$ID,-2$$TR,"Once"$
$ID,2$$TR,"Zenith"$
$ID,2$$ID,-2$$TR,"User"$
$ID,2$#include "DoDistro";;OutU16(0x4004, 0x3400);
$ID,-2$$ID,-2$$TR,"ZenithOS"$
$ID,2$$TR,"BlackDiamond"$
$ID,2$I64 best_score=9999;
$ID,-2$$TR,"Talons"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"DunGen"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"CastleFrankenstein"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"ZoneOut"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"Varoom"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"FlapBat"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"RawHide"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"KeepAway"$
$ID,2$I64 best_score0=0,best_score1=9999;
$ID,-2$$TR,"XCaliber"$
$ID,2$I64 best_score=0;
I64 message_flags=0;
$ID,-2$$TR,"Wenceslas"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"BomberGolf"$
$ID,2$I64 best_score=99999;
$ID,-2$$TR,"OSTestSuite"$
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
progress3_tf=0.000;progress4_tf=218.934;
$ID,-2$$ID,-2$$TR,"DemoCompany"$
$ID,2$$TR,"Game1"$
$ID,2$F64 best_score=267.42538;
$TR,"SimpleVal"$
$ID,2$1235;
$ID,-2$$ID,-2$$ID,-2$

View file

@ -17,7 +17,7 @@ Bool MyPutKey(I64 ch,I64 sc)
//You can customize keys. This routine
//is called before the main editor
//key hndlr $LK,"DocPutKey",A="MN:DocPutKey"$().
//key handler $LK,"DocPutKey",A="MN:DocPutKey"$().
//You can intercept any key.
//Return TRUE if you completely

Binary file not shown.

View file

@ -88,7 +88,7 @@ Bool BootDVDProbeAll(CBlkDev *bd)
}
}
U0 ATARepEntry(I64 base0,I64 base1,I64 unit,U8 *msg,
U0 ATARepEntry(I64 base0,I64 base1,I64 unit,U8 *message,
CATARep **_head,I64 *num_hints)
{
I64 type;
@ -102,7 +102,7 @@ U0 ATARepEntry(I64 base0,I64 base1,I64 unit,U8 *msg,
"$$RED$$HardDrive$$LTBLUE$$ATA";
else
"$$RED$$CD/DVDDrive$$LTBLUE$$ATAPI";
"%s$$FG$$\n",msg;
"%s$$FG$$\n",message;
if (base0==blkdev.ins_base0 && unit==blkdev.ins_unit)
"$$PURPLE$$(Drive originally installed from.)$$FG$$\n";
"Base0:0x%04XBase1:0x%04XUnit:%d$$LM,0$$\n",

View file

@ -80,7 +80,7 @@ Bool CopySingle(U8 *f1,U8 *f2) //Just one file
}
I64 Del(U8 *files_find_mask,Bool make_mask=FALSE,
Bool del_dir=FALSE,Bool print_msg=TRUE)
Bool del_dir=FALSE,Bool print_message=TRUE)
{//Delete files.
I64 res=0;
CDirContext *dirc;
@ -88,11 +88,11 @@ I64 Del(U8 *files_find_mask,Bool make_mask=FALSE,
switch (dirc->dv->fs_type) {
case FSt_REDSEA:
res=RedSeaFilesDel(dirc->dv,Fs->cur_dir,dirc->mask,
0,del_dir,print_msg);
0,del_dir,print_message);
break;
case FSt_FAT32:
res=FAT32FilesDel(dirc->dv,Fs->cur_dir,dirc->mask,
0,del_dir,print_msg);
0,del_dir,print_message);
break;
default:
PrintErr("File System Not Supported\n");

View file

@ -710,7 +710,7 @@ Bool FAT32DirNew(CDrive *dv,U8 *cur_dir,CDirEntry *tmpde,Bool free_old_chain)
}
I64 FAT32FilesDel(CDrive *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
Bool del_dir,Bool print_msg)
Bool del_dir,Bool print_message)
{
CFAT32DirEntry *buf,*last_buf,*tmp_buf;
I64 i,res=0,attr,xsum=0,last_dir_clus=INVALID_CLUS,
@ -742,7 +742,7 @@ I64 FAT32FilesDel(CDrive *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
FATFromName(long_name.name,buf[cur_dir_entry].name);
if (FilesFindMatch(long_name.name,files_find_mask,fuf_flags)) {
if (!(attr & RS_ATTR_DIR)) res++;
if (print_msg)
if (print_message)
"Del %s\n",long_name.name;
*buf[cur_dir_entry].name=0xE5;
i=1;

View file

@ -454,7 +454,7 @@ Bool RedSeaDirNew(CDrive *dv,U8 *cur_dir,CDirEntry *tmpde,Bool free_old_chain)
}
I64 RedSeaFilesDel(CDrive *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
Bool del_dir,Bool print_msg)
Bool del_dir,Bool print_message)
{
CDirEntry *buf,*buf2,*ptr;
I64 i=0,res=0,ch,j=0,n=BLK_SIZE/CDIR_SIZE,cur_dir_clus;
@ -481,7 +481,7 @@ I64 RedSeaFilesDel(CDrive *dv,U8 *cur_dir,U8 *files_find_mask,I64 fuf_flags,
!(ptr->attr & RS_ATTR_DIR)) &&
FilesFindMatch(ptr->name,files_find_mask,fuf_flags)) {
if (!(ptr->attr & RS_ATTR_DIR)) res++;
if (print_msg)
if (print_message)
"Del %s\n",ptr->name;
ptr->attr|=RS_ATTR_DELETED;
BlkWrite(dv,buf(U8 *)+j<<BLK_SIZE_BITS,cur_dir_clus+j,1);

View file

@ -22,14 +22,14 @@ U0 JobCtrlInit(CJobCtrl *ctrl)
ctrl->flags=0;
}
U0 TaskRstAwaitingMsg(CTask *task=NULL)
{//Pop-ups get parent messages so wake-up our pop-ups if we got a msg.
U0 TaskRstAwaitingMessage(CTask *task=NULL)
{//Pop-ups get parent messages so wake-up our pop-ups if we got a message.
if (!task) task=Fs;
PUSHFD
CLI
do {
if (TaskValidate(task))
LBtr(&task->task_flags,TASKf_AWAITING_MSG);
LBtr(&task->task_flags,TASKf_AWAITING_MESSAGE);
else
break;
} while (task=task->popup_task);
@ -60,7 +60,7 @@ CJob *TaskExe(CTask *srv,CTask *master,U8 *data,I64 flags)
return NULL;
} else {
LBtr(&srv->task_flags,TASKf_IDLE);
TaskRstAwaitingMsg(srv);
TaskRstAwaitingMessage(srv);
QueueInsert(res,srv->srv_ctrl.last_waiting);
LBtr(&srv->srv_ctrl.flags,JOBCf_LOCKED);
if (Bt(&flags,JOBf_WAKE_MASTER)) {
@ -108,7 +108,7 @@ CJob *TaskText(CTask *srv,CTask *master,U8 *data,I64 flags)
res=NULL;
} else {
LBtr(&task->task_flags,TASKf_IDLE);
TaskRstAwaitingMsg(task);
TaskRstAwaitingMessage(task);
QueueInsert(res,task->srv_ctrl.last_waiting);
LBtr(&task->srv_ctrl.flags,JOBCf_LOCKED);
}
@ -116,10 +116,10 @@ CJob *TaskText(CTask *srv,CTask *master,U8 *data,I64 flags)
return res;
}
CJob *TaskMsg(CTask *_srv,CTask *master,
I64 msg_code,I64 arg1,I64 arg2,I64 flags)
CJob *TaskMessage(CTask *_srv,CTask *master,
I64 message_code,I64 arg1,I64 arg2,I64 flags)
{//Post message to servant task. Tell who the master task is.
//See $LK,"flags",A="MN:JOBf_WAKE_MASTER"$ and $LK,"msg_code",A="MN:MSG_CMD"$.
//See $LK,"flags",A="MN:JOBf_WAKE_MASTER"$ and $LK,"message_code",A="MN:MESSAGE_CMD"$.
CJob *tmpc1,*tmpc;
CTask *srv=_srv;
if (!TaskValidate(srv) || master && !TaskValidate(master)||
@ -127,14 +127,14 @@ CJob *TaskMsg(CTask *_srv,CTask *master,
return NULL;
tmpc=ACAlloc(sizeof(CJob));
tmpc->master_task=master;
tmpc->job_code=JOBT_MSG;
tmpc->msg_code=AbsI64(msg_code); //negative means do a down and up
tmpc->job_code=JOBT_MESSAGE;
tmpc->message_code=AbsI64(message_code); //negative means do a down and up
tmpc->aux1=arg1;
tmpc->aux2=arg2;
tmpc->flags=flags;
PUSHFD
if (Bt(&sys_semas[SEMA_RECORD_MACRO],0) &&
srv!=sys_macro_task && msg_code==MSG_KEY_DOWN) {
srv!=sys_macro_task && message_code==MESSAGE_KEY_DOWN) {
tmpc1=AMAllocIdent(tmpc);
CLI
QueueInsert(tmpc1,sys_macro_head.last);
@ -151,13 +151,13 @@ CJob *TaskMsg(CTask *_srv,CTask *master,
tmpc=NULL;
} else {
LBtr(&srv->task_flags,TASKf_IDLE);
TaskRstAwaitingMsg(srv);
TaskRstAwaitingMessage(srv);
QueueInsert(tmpc,srv->srv_ctrl.last_waiting);
LBtr(&srv->srv_ctrl.flags,JOBCf_LOCKED);
}
POPFD
if (msg_code<0) //Down-Up
TaskMsg(_srv,master,-msg_code+1,arg1,arg2,flags);
if (message_code<0) //Down-Up
TaskMessage(_srv,master,-message_code+1,arg1,arg2,flags);
return tmpc;
}
@ -239,27 +239,27 @@ U0 TaskWait(CTask *task=NULL,Bool cmd_line_pmt=FALSE)
}
}
U0 PostMsg(CTask *task,I64 msg_code,I64 arg1,I64 arg2,I64 flags=0)
{//Post message to a task and return immediately. See $LK,"msg_code",A="MN:MSG_CMD"$.
U0 PostMessage(CTask *task,I64 message_code,I64 arg1,I64 arg2,I64 flags=0)
{//Post message to a task and return immediately. See $LK,"message_code",A="MN:MESSAGE_CMD"$.
if (TaskValidate(task)) {
if (Bt(&task->task_flags,TASKf_INPUT_FILTER_TASK))
TaskMsg(task->last_input_filter_task,NULL,msg_code,arg1,arg2,
TaskMessage(task->last_input_filter_task,NULL,message_code,arg1,arg2,
flags|1<<JOBf_DONT_FILTER);
else
TaskMsg(task,NULL,msg_code,arg1,arg2,flags);
TaskMessage(task,NULL,message_code,arg1,arg2,flags);
}
}
U0 PostMsgWait(CTask *task,I64 msg_code,I64 arg1,I64 arg2,I64 flags=0)
{//Post message to a task and wait until task is idle.See $LK,"msg_code",A="MN:MSG_CMD"$.
PostMsg(task,msg_code,arg1,arg2,flags);
U0 PostMessageWait(CTask *task,I64 message_code,I64 arg1,I64 arg2,I64 flags=0)
{//Post message to a task and wait until task is idle.See $LK,"message_code",A="MN:MESSAGE_CMD"$.
PostMessage(task,message_code,arg1,arg2,flags);
TaskWait(task);
}
U0 Msg(I64 msg_code,I64 arg1,I64 arg2,I64 flags=0)
U0 Message(I64 message_code,I64 arg1,I64 arg2,I64 flags=0)
{//Post message to current task and return immediately.
//See $LK,"msg_code",A="MN:MSG_CMD"$.
PostMsg(Fs,msg_code,arg1,arg2,flags);
//See $LK,"message_code",A="MN:MESSAGE_CMD"$.
PostMessage(Fs,message_code,arg1,arg2,flags);
}
#define JOB_DONE 0

View file

@ -532,7 +532,7 @@ U0 DebugHelp()
U0 Debug2()
{
Bool old_win_inhibit,old_waiting_msg,old_single;
Bool old_win_inhibit,old_waiting_message,old_single;
I64 i,old_getstr2;
U8 buf[200];
if (dbg.panic) {
@ -544,7 +544,7 @@ U0 Debug2()
U(Fs->rip,1);
} else
dbg.panic=TRUE;
old_waiting_msg=LBtr(&Fs->task_flags,TASKf_AWAITING_MSG);
old_waiting_message=LBtr(&Fs->task_flags,TASKf_AWAITING_MESSAGE);
old_win_inhibit=Fs->win_inhibit;
Fs->win_inhibit=WIG_USER_TASK_DFT;
sys_focus_task=Fs;
@ -558,7 +558,7 @@ U0 Debug2()
UserTaskCont;
fp_getstr2=old_getstr2;
Fs->win_inhibit=old_win_inhibit;
LBEqu(&Fs->task_flags,TASKf_AWAITING_MSG,old_waiting_msg);
LBEqu(&Fs->task_flags,TASKf_AWAITING_MESSAGE,old_waiting_message);
}
U0 Fault3(I64 fault_num,I64 fault_err_code)
@ -571,8 +571,8 @@ U0 Fault3(I64 fault_num,I64 fault_err_code)
dbg.mp_crash->cpu_num=Gs->num;
dbg.mp_crash->task=Fs;
dbg.mp_crash->rip=Fs->rip;
dbg.mp_crash->msg=dbg.msg;
dbg.mp_crash->msg_num=dbg.msg_num;
dbg.mp_crash->message=dbg.message;
dbg.mp_crash->message_num=dbg.message_num;
MPInt(I_MP_CRASH,0);
SysHlt;
}
@ -580,10 +580,10 @@ U0 Fault3(I64 fault_num,I64 fault_err_code)
">Help;\t//For help.\n\n";
Beep(62,TRUE);
if (fault_num==I_DBG) {
if (dbg.msg) {
"\n!!!%s",dbg.msg;
if (dbg.msg_num)
"%016X",dbg.msg_num;
if (dbg.message) {
"\n!!!%s",dbg.message;
if (dbg.message_num)
"%016X",dbg.message_num;
"!!!\n\n";
}
}
@ -635,18 +635,18 @@ U0 Fault2(I64 fault_num,I64 fault_err_code)
Exit;
}
U0 Panic(U8 *msg=NULL,I64 msg_num=0,Bool panic=TRUE)
U0 Panic(U8 *message=NULL,I64 message_num=0,Bool panic=TRUE)
{//Enter the debugger with panic?
PUSHFD
CLI
dbg.msg=msg;
dbg.msg_num=msg_num;
dbg.message=message;
dbg.message_num=message_num;
dbg.panic=panic;
INT I_DBG
POPFD
}
U0 Debug(U8 *msg=NULL,I64 msg_num=0)
U0 Debug(U8 *message=NULL,I64 message_num=0)
{//Enter debugger, no panic.
Panic(msg,msg_num,FALSE);
Panic(message,message_num,FALSE);
}

View file

@ -14,13 +14,13 @@ _TEST_EXCEPT::
MOV R15,U64 CExcept.r15[RAX]
PUSH U64 CExcept.rflags[RAX]
POPFD
JMP U64 CExcept.hndlr_catch[RAX]
JMP U64 CExcept.handler_catch[RAX]
_TAKE_EXCEPT::
XOR RAX,RAX
MOV RAX,FS:U64 CTask.last_except[RAX]
MOV RSP,U64 CExcept.rsp[RAX]
JMP U64 CExcept.hndlr_untry[RAX]
JMP U64 CExcept.handler_untry[RAX]
_SAVE_EXCEPT_REGS::
PUSH RBP
@ -43,7 +43,7 @@ _extern _TAKE_EXCEPT U0 TakeExcept();
_extern _SAVE_EXCEPT_REGS U0 SaveExceptRegs(CExcept *t);
U0 PutExcept(Bool catch_it=TRUE)
{//Print exception msg and catch exception.
{//Print exception message and catch exception.
"Except:%c:",Fs->except_ch;
"%P:%P:%P:%P:%P:%P\n",Fs->except_callers[0],Fs->except_callers[1],
Fs->except_callers[2],Fs->except_callers[3],Fs->except_callers[4],
@ -65,8 +65,8 @@ U0 SysTry(U8 *catch_start,U8 *untry_start)
{
I64 *rbp=GetRBP;
CExcept *tmpt=MAlloc(sizeof(CExcept));
tmpt->hndlr_catch=catch_start;
tmpt->hndlr_untry=untry_start;
tmpt->handler_catch=catch_start;
tmpt->handler_untry=untry_start;
tmpt->rsp=rbp(U8 *)+sizeof(CTryStk);
tmpt->rbp=*rbp;
tmpt->rflags=GetRFlags;
@ -117,13 +117,13 @@ U0 throw(I64 ch=0,Bool no_log=FALSE)
U0 Break()
{//Send <CTRL-ALT-c>.
if (Bt(&Fs->task_flags,TASKf_BREAK_TO_SHIFT_ESC))
Msg(MSG_KEY_DOWN,CH_SHIFT_ESC,0x20100000201);
Message(MESSAGE_KEY_DOWN,CH_SHIFT_ESC,0x20100000201);
else {
Fs->wake_jiffy=0;
TaskRstAwaitingMsg;
TaskRstAwaitingMessage;
DrivesRelease();
BlkDevsRelease();
FlushMsgs;
FlushMessages;
throw('Break');
}
}

View file

@ -29,7 +29,7 @@ extern U8 *Define(U8 *dname);
extern I64 DefineMatch(U8 *needle,U8 *haystack_lst_dname,I64 flags=0);
extern U8 *DefineSub(I64 sub,U8 *dname);
extern I64 Del(U8 *files_find_mask,Bool make_mask=FALSE,
Bool del_dir=FALSE,Bool print_msg=TRUE);
Bool del_dir=FALSE,Bool print_message=TRUE);
extern Bool DirMk(U8 *filename,I64 entry_cnt=0);
extern Bool Drive(U8 drv_let);
extern U8 Drive2Letter(CDrive *dv=NULL);
@ -57,7 +57,7 @@ extern Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0);
extern U8 *FileNameAbs(U8 *_filename,I64 fuf_flags=0);
extern U8 *FileRead(U8 *filename,I64 *_size=NULL,I64 *_attr=NULL);
extern I64 FileWrite(U8 *filename,U8 *fbuf,I64 size,CDate cdt=0,I64 attr=0);
extern I64 FlushMsgs(CTask *task=NULL);
extern I64 FlushMessages(CTask *task=NULL);
extern I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE);
extern I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE);
extern CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL,
@ -77,8 +77,8 @@ 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 U0 Msg(I64 msg_code,I64 arg1,I64 arg2,I64 flags=0);
extern U0 Panic(U8 *msg=NULL,I64 msg_num=0,Bool panic=TRUE);
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 PutChars(U64 ch);
@ -98,9 +98,9 @@ extern CTask *SpawnQueue(U0 (*fp_addr)(U8 *data),U8 *data=NULL,
extern U8 *StrPrint(U8 *dst,U8 *fmt,...);
extern U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags);
extern Bool Suspend(CTask *task=NULL,Bool state=TRUE);
extern CJob *TaskMsg(CTask *_srv,CTask *master,
I64 msg_code,I64 arg1,I64 arg2,I64 flags);
extern U0 TaskRstAwaitingMsg(CTask *task=NULL);
extern CJob *TaskMessage(CTask *_srv,CTask *master,
I64 message_code,I64 arg1,I64 arg2,I64 flags);
extern U0 TaskRstAwaitingMessage(CTask *task=NULL);
extern Bool TaskValidate(CTask *task);
extern U0 TaskWait(CTask *task=NULL,Bool cmd_line_pmt=FALSE);
extern CTask *User(U8 *fmt=NULL,...);

View file

@ -106,11 +106,11 @@ U8 *IntEntryGet(I64 irq)
return res;
}
U8 *IntEntrySet(I64 irq,U0 (*fp_new_hndlr)(),I64 type=IDTET_IRQ,I64 dpl=0)
U8 *IntEntrySet(I64 irq,U0 (*fp_new_handler)(),I64 type=IDTET_IRQ,I64 dpl=0)
{//Set interrupt vector. See $LK,"IDTET_IRQ",A="MN:IDTET_IRQ"$.
//See $LK,"::/Demo/Lectures/InterruptDemo.HC"$.
//See $LK,"::/Demo/MultiCore/Interrupts.HC"$.
I64 fp=fp_new_hndlr;
I64 fp=fp_new_handler;
U8 *res,*dst;
PUSHFD
CLI
@ -155,8 +155,8 @@ interrupt U0 IntDivZero()
dbg.mp_crash->task=Fs;
MOV RAX,U64 8[RBP] //Get RIP off of stk.
dbg.mp_crash->rip=GetRAX;
dbg.mp_crash->msg="Div Zero";
dbg.mp_crash->msg_num=0;
dbg.mp_crash->message="Div Zero";
dbg.mp_crash->message_num=0;
MPInt(I_MP_CRASH,0);
SysHlt;
}

View file

@ -368,14 +368,14 @@ I64 ExeCmdLine(CCompCtrl *cc)
U0 SrvTaskCont()
{//Act as server task in a loop handling commands.
I64 old_flags=GetRFlags;
FlushMsgs;
FlushMessages;
while (TRUE) {
CLI
if (JobsHandler(old_flags) && Fs->title_src==TTS_TASK_NAME)
MemCpy(Fs->task_title,Fs->task_name,TASK_NAME_LEN);
FlushMsgs;
FlushMessages;
LBts(&Fs->task_flags,TASKf_IDLE);
LBts(&Fs->task_flags,TASKf_AWAITING_MSG);
LBts(&Fs->task_flags,TASKf_AWAITING_MESSAGE);
Yield;
SetRFlags(old_flags);
}
@ -452,7 +452,7 @@ I64 TaskEnd()
if (task->task_end_cb) {
task->wake_jiffy=0;
LBtr(&task->task_flags,TASKf_KILL_TASK);
TaskRstAwaitingMsg(task);
TaskRstAwaitingMessage(task);
Suspend(task,FALSE);
task->rip=task->task_end_cb;
task->task_end_cb=NULL;

File diff suppressed because one or more lines are too long

View file

@ -626,7 +626,7 @@ class CSema
#define SEMA_UPDATE_WIN_Z_BUF 15
#define SEMA_TT 16
#define SEMA_MUTE 17
#define SEMA_JUST_PUMP_MSGS 18
#define SEMA_JUST_PUMP_MESSAGES 18
#define SEMA_TMBEAT 19
#define SEMA_FIX 20
#define SEMA_SEMAS_NUM 21
@ -3092,7 +3092,7 @@ public class CMenuEntry
CMenuEntry *next;
CMenuEntry *sub;
U8 name[32];
I64 msg_code,arg1,arg2;
I64 message_code,arg1,arg2;
Bool checked,dir,pad[6];
};
@ -3116,7 +3116,7 @@ class CBpt
class CExcept
{
CExcept *next,*last;
I64 hndlr_catch,hndlr_untry,
I64 handler_catch,handler_untry,
rsp,rbp,rflags,rsi,rdi,r10,r11,r12,r13,r14,r15;
};
@ -3138,7 +3138,7 @@ class CFPU
#define JOBf_ADD_TO_QUE 8
#define JOBT_TEXT_INPUT 0 //$LK,"TaskText",A="MN:TaskText"$() Feed StdIn
#define JOBT_MSG 1 //$LK,"TaskMsg",A="MN:TaskMsg"$() Post msg
#define JOBT_MESSAGE 1 //$LK,"TaskMessage",A="MN:TaskMessage"$() Post message
#define JOBT_EXE_STR 2 //$LK,"TaskExe",A="MN:TaskExe"$() Compile & execute src code text
//MP cmds
#define JOBT_CALL 3 //$LK,"JobQueue",A="MN:JobQueue"$() Tell MP to call function
@ -3148,13 +3148,13 @@ class CJob
{
CJob *next,*last;
CJobCtrl *ctrl;
I64 job_code,flags,msg_code;
I64 job_code,flags,message_code;
I64 (*addr)(U8 *fun_arg);
U8 *fun_arg;
U8 *aux_str;
I64 aux1,aux2, //Sometimes called arg1 and arg2. (Windows msg param1 param2)
I64 aux1,aux2, //Sometimes called arg1 and arg2. (Windows message param1 param2)
res;
CTask *spawned_task,
@ -3170,27 +3170,27 @@ class CJobCtrl
};
#help_index "Messages"
//See $LK,"::/Demo/MsgLoop.HC"$
#define MSG_NULL 0
#define MSG_CMD 1
#define MSG_KEY_DOWN 2 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press <CTRL-SHIFT-L>
#define MSG_KEY_UP 3 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press <CTRL-SHIFT-L>
#define MSG_MS_MOVE 4 //(x,y)
#define MSG_MS_L_DOWN 5 //(x,y)
#define MSG_MS_L_UP 6 //(x,y)
#define MSG_MS_L_D_DOWN 7 //(x,y)
#define MSG_MS_L_D_UP 8 //(x,y)
#define MSG_MS_R_DOWN 9 //(x,y)
#define MSG_MS_R_UP 10 //(x,y)
#define MSG_MS_R_D_DOWN 11 //(x,y)
#define MSG_MS_R_D_UP 12 //(x,y)
//See $LK,"::/Demo/MessageLoop.HC"$
#define MESSAGE_NULL 0
#define MESSAGE_CMD 1
#define MESSAGE_KEY_DOWN 2 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press <CTRL-SHIFT-L>
#define MESSAGE_KEY_UP 3 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press <CTRL-SHIFT-L>
#define MESSAGE_MS_MOVE 4 //(x,y)
#define MESSAGE_MS_L_DOWN 5 //(x,y)
#define MESSAGE_MS_L_UP 6 //(x,y)
#define MESSAGE_MS_L_D_DOWN 7 //(x,y)
#define MESSAGE_MS_L_D_UP 8 //(x,y)
#define MESSAGE_MS_R_DOWN 9 //(x,y)
#define MESSAGE_MS_R_UP 10 //(x,y)
#define MESSAGE_MS_R_D_DOWN 11 //(x,y)
#define MESSAGE_MS_R_D_UP 12 //(x,y)
//Fake messages used to send both an up and down.
#define MSG_KEY_DOWN_UP -2 //Down & UP
#define MSG_MS_L_DOWN_UP -5 //Down & Up
#define MSG_MS_L_D_DOWN_UP -7 //Down & Up
#define MSG_MS_R_DOWN_UP -9 //Down & Up
#define MSG_MS_R_D_DOWN_UP -11 //Down & Up
#define MESSAGE_KEY_DOWN_UP -2 //Down & UP
#define MESSAGE_MS_L_DOWN_UP -5 //Down & Up
#define MESSAGE_MS_L_D_DOWN_UP -7 //Down & Up
#define MESSAGE_MS_R_DOWN_UP -9 //Down & Up
#define MESSAGE_MS_R_D_DOWN_UP -11 //Down & Up
#help_index "Task/Settings"
#define TSF_SAME_SONG 1
@ -3235,7 +3235,7 @@ public class CTaskSettings
#define TASKf_FILTER_INPUT 6
#define TASKf_HAS_SONG 7
#define TASKf_DISABLE_BPTS 8
#define TASKf_AWAITING_MSG 9
#define TASKf_AWAITING_MESSAGE 9
#define TASKf_BREAK_LOCKED 10
#define TASKf_PENDING_BREAK 11
#define TASKf_BREAK_TO_SHIFT_ESC 12
@ -3767,7 +3767,7 @@ class CKeyDevGlbls
**ctrl_alt_ret_addr; //addr of ret addr on stack in kbd irq
U8 **ctrl_alt_no_shift_descs,**ctrl_alt_shift_descs,
desc[STR_LEN],
*hndlr;
*handler;
};
#help_index "Snd"
@ -3813,15 +3813,15 @@ class CMPCrash
I64 cpu_num;
CTask *task;
I64 rip;
U8 *msg;
I64 msg_num;
U8 *message;
I64 message_num;
};
public class CDebugGlbls
{
CTask *focus_task;
U8 *msg;
I64 msg_num;
U8 *message;
I64 message_num;
CMPCrash *mp_crash;
U8 *int_fault_code,
*fix_file_line;
@ -3846,7 +3846,7 @@ public class CDebugGlbls
#define STD_DISTRO_DVD_CFG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
#help_index "Registry"
//Registry sys_msg_flags. $LK,"RegOneTimePopUp",A="MN:RegOneTimePopUp"$()
//Registry sys_message_flags. $LK,"RegOneTimePopUp",A="MN:RegOneTimePopUp"$()
#define ARf_FLOODFILL 0
#define ARf_CSPRITE_INS_CLIP 1
#define ARf_PLANAR_SYMMETRY 2

View file

@ -226,8 +226,8 @@ public extern U0 RawPutChar(I64 ch);
public extern U0 VGAFlush();
#help_index "Debugging;Debugging/Debugger"
public extern U0 Debug(U8 *msg=NULL,I64 msg_num=0);
public extern U0 Panic(U8 *msg=NULL,I64 msg_num=0,Bool panic=TRUE);
public extern U0 Debug(U8 *message=NULL,I64 message_num=0);
public extern U0 Panic(U8 *message=NULL,I64 message_num=0,Bool panic=TRUE);
#help_index "Define;Char/Define"
#help_file "::/Doc/Define"
@ -279,7 +279,7 @@ public extern I64 FSize(CFile *f);
#help_index "File/Cmd Line (Typically);Cmd Line (Typically)"
public extern Bool Cd(U8 *dirname=NULL,Bool make_dirs=FALSE);
public extern I64 Del(U8 *files_find_mask,Bool make_mask=FALSE,
Bool del_dir=FALSE,Bool print_msg=TRUE);
Bool del_dir=FALSE,Bool print_message=TRUE);
public extern I64 Dir(U8 *files_find_mask="*",Bool full=FALSE);
public extern Bool DirMk(U8 *filename,I64 entry_cnt=0);
public extern Bool Drive(U8 drv_let);
@ -465,7 +465,7 @@ public extern I64 JobsHandler(I64 run_flags,CTask *task=NULL);
extern U0 SrvCmdLine();
public extern U0 SrvTaskCont();
public extern CJob *TaskExe(CTask *srv,CTask *master,U8 *data,I64 flags);
public extern U0 TaskRstAwaitingMsg(CTask *task=NULL);
public extern U0 TaskRstAwaitingMessage(CTask *task=NULL);
public extern U0 UserTaskCont();
#help_index "Job/Exe;Task/Job/Exe;Compiler"
@ -477,10 +477,10 @@ public extern I64 PopUpPrint(U8 *fmt,...);
public extern I64 JobResGet(CJob *rqst=NULL);
public extern Bool JobResScan(CJob *rqst=NULL,I64 *_res=NULL);
#help_index "Job/Text & Msgs;Task/Job/Text & Msgs"
#help_index "Job/Text & Messages;Task/Job/Text & Messages"
public extern CJob *TaskText(CTask *srv,CTask *master,U8 *data,I64 flags);
#help_index "Job/Text & Msgs;Task/Job/Text & Msgs;InFile;StdIn/InFile"
#help_index "Job/Text & Messages;Task/Job/Text & Messages;InFile;StdIn/InFile"
public extern U0 In(U8 *fmt,...);
public extern U0 InFile(U8 *filename);
public extern U0 InStr(U8 *fmt,...);
@ -489,21 +489,21 @@ public extern U0 XTalkStr(CTask *task,U8 *fmt,...);
public extern U0 XTalkStrWait(CTask *task,U8 *fmt,...);
public extern U0 XTalkWait(CTask *task,U8 *fmt,...);
#help_index "Job/Text & Msgs;Task/Job/Text & Msgs;Messages"
public extern U0 Msg(I64 msg_code,I64 arg1,I64 arg2,I64 flags=0);
public extern U0 PostMsg(CTask *task,
I64 msg_code,I64 arg1,I64 arg2,I64 flags=0);
public extern U0 PostMsgWait(CTask *task,I64 msg_code,
#help_index "Job/Text & Messages;Task/Job/Text & Messages;Messages"
public extern U0 Message(I64 message_code,I64 arg1,I64 arg2,I64 flags=0);
public extern U0 PostMessage(CTask *task,
I64 message_code,I64 arg1,I64 arg2,I64 flags=0);
public extern U0 PostMessageWait(CTask *task,I64 message_code,
I64 arg1,I64 arg2,I64 flags=0);
public extern CJob *TaskMsg(CTask *srv,CTask *master,
I64 msg_code,I64 arg1,I64 arg2,I64 flags);
public extern CJob *TaskMessage(CTask *srv,CTask *master,
I64 message_code,I64 arg1,I64 arg2,I64 flags);
#help_index "Job;Task/Job"
#help_file "::/Doc/Job"
#help_index "Keyboard Devices/System;Char/System"
#help_file "::/Doc/KeyDev"
public extern U0 CtrlAltCBSet(U8 ch,U0 (*fp_hndlr)(I64 sc),
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 CKeyDevEntry *KeyDevAdd(Bool (*fp_put_key)(I64 ch,I64 sc),
@ -521,12 +521,12 @@ public extern I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,
public extern I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,
Bool raw_cursor=FALSE);
public extern I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE);
public extern U8 *GetStr(U8 *msg=NULL,U8 *dft=NULL,I64 flags=0);
public extern U8 *GetStr(U8 *message=NULL,U8 *dft=NULL,I64 flags=0);
extern U0 KbdInit();
public extern I64 KbdMsEvtTime();
extern U0 KbdMsHandler(Bool poll_kbd,Bool poll_ms);
extern U0 KbdMsInit();
extern I64 KbdMsgsQueue();
extern I64 KbdMessagesQueue();
public extern U0 KbdTypeMatic(U8 delay);
extern Bool MsHardDriverInstall();
public extern I64 PressAKey();
@ -587,12 +587,12 @@ public extern CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL,
public extern I64 *MemPageTable(U8 *a);
#help_index "Messages"
#help_file "::/Doc/Msgs"
public extern I64 FlushMsgs(CTask *task=NULL);
public extern I64 GetMsg(I64 *_arg1=NULL,I64 *_arg2=NULL,
#help_file "::/Doc/Messages"
public extern I64 FlushMessages(CTask *task=NULL);
public extern I64 GetMessage(I64 *_arg1=NULL,I64 *_arg2=NULL,
I64 mask=~1,CTask *task=NULL);
extern U0 InputFilterTask();
public extern I64 ScanMsg(I64 *_arg1=NULL,I64 *_arg2=NULL,
public extern I64 ScanMessage(I64 *_arg1=NULL,I64 *_arg2=NULL,
I64 mask=~1,CTask *task=NULL);
#help_index "Misc"
@ -662,7 +662,7 @@ public extern I64 ATARep(Bool pmt=TRUE,
#help_index "Processor"
public extern U8 *IntEntryGet(I64 irq);
public extern U8 *IntEntrySet(I64 irq,
U0 (*fp_new_hndlr)(),I64 type=IDTET_IRQ,I64 dpl=0);
U0 (*fp_new_handler)(),I64 type=IDTET_IRQ,I64 dpl=0);
#help_index "ScreenCast;Cmd Line (Typically)"
public extern Bool ScreenCast(Bool val=ON,Bool just_audio=FALSE,

View file

@ -54,10 +54,10 @@ U0 PutS(U8 *st)
}
U0 KeyDescSet(U8 *fmt,...)
{//Call this from key hndlr to report desc in $LK,"KeyMap",A="MN:KeyMap"$().
{//Call this from key handler to report desc in $LK,"KeyMap",A="MN:KeyMap"$().
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
StrCpy(keydev.desc,buf);
keydev.hndlr=Caller;
keydev.handler=Caller;
Free(buf);
}
@ -108,7 +108,7 @@ Bool KDRawPutS(U8 *st)
Bool KDInputFilterPutKey(I64 ch,I64 scan_code)
{
if (Bt(&Fs->task_flags,TASKf_INPUT_FILTER_TASK)) {
Msg(MSG_KEY_DOWN,ch,scan_code);
Message(MESSAGE_KEY_DOWN,ch,scan_code);
return TRUE;
} else
return FALSE;
@ -119,7 +119,7 @@ Bool KDInputFilterPutS(U8 *st)
I64 ch;
if (Bt(&Fs->task_flags,TASKf_INPUT_FILTER_TASK)) {
while (ch=*st++)
Msg(MSG_KEY_DOWN,ch,0);
Message(MESSAGE_KEY_DOWN,ch,0);
return TRUE;
} else
return FALSE;
@ -175,12 +175,12 @@ U0 CtrlAltX(I64)
LBts(sys_ctrl_alt_flags,CTRL_ALT_X);
}
U0 CtrlAltCBSet(U8 ch,U0 (*fp_hndlr)(I64 sc),
U0 CtrlAltCBSet(U8 ch,U0 (*fp_handler)(I64 sc),
U8 *no_shift_desc=NULL,U8 *shift_desc=NULL,Bool in_irq=FALSE)
{//Set callback for <CTRL-ALT-letter>.
ch=ToUpper(ch)-'A';
if (ch<26) {
keydev.fp_ctrl_alt_cbs[ch]=fp_hndlr;
keydev.fp_ctrl_alt_cbs[ch]=fp_handler;
Free(keydev.ctrl_alt_no_shift_descs[ch]);
if (no_shift_desc)

View file

@ -202,7 +202,7 @@ U0 CoreAPSethTask()
while (LBts(&ctrl->flags,JOBCf_LOCKED));
} while (ctrl->next_waiting!=ctrl && JobRunOne(GetRFlags,ctrl));
CLI
LBts(&Fs->task_flags,TASKf_AWAITING_MSG);
LBts(&Fs->task_flags,TASKf_AWAITING_MESSAGE);
LBtr(&ctrl->flags,JOBCf_LOCKED);
LBts(&Fs->task_flags,TASKf_IDLE);
Yield;
@ -236,7 +236,7 @@ CJob *JobQueue(I64 (*fp_addr)(U8 *data),U8 *data=NULL,
CLI
while (LBts(&ctrl->flags,JOBCf_LOCKED))
Yield;
if (ctrl->next_waiting==ctrl && LBtr(&seth->task_flags,TASKf_AWAITING_MSG))
if (ctrl->next_waiting==ctrl && LBtr(&seth->task_flags,TASKf_AWAITING_MESSAGE))
MPInt(I_WAKE,target_cpu);
QueueInsert(tmpc,ctrl->last_waiting);
LBtr(&ctrl->flags,JOBCf_LOCKED);
@ -344,7 +344,7 @@ U0 Core0StartMP()
//Make sure they're all up-and-running
for (i=1;i<my_mp_cnt;i++)
while (!Bt(&cpu_structs[i].seth_task->task_flags,TASKf_AWAITING_MSG))
while (!Bt(&cpu_structs[i].seth_task->task_flags,TASKf_AWAITING_MESSAGE))
PAUSE;
POPFD
@ -385,5 +385,5 @@ interrupt U0 IntMPCrash()
text.raw_flags|=RWF_SHOW_DOLLAR;
"MP Crash CPU%02X Task:%08X\n"
"RIP:%P\n",dbg.mp_crash->cpu_num,dbg.mp_crash->task,dbg.mp_crash->rip;
Panic(dbg.mp_crash->msg,dbg.mp_crash->msg_num);
Panic(dbg.mp_crash->message,dbg.mp_crash->message_num);
}

View file

@ -177,7 +177,7 @@ RESTORE_RSI_TASK2:
@@20: BT U64 CTask.task_flags[RSI],TASKf_KILL_TASK
JC END_RSI_TASK
TEST U64 CTask.task_flags[RSI],
1<<TASKf_AWAITING_MSG|1<<TASKf_SUSPENDED
1<<TASKf_AWAITING_MESSAGE|1<<TASKf_SUSPENDED
JNZ @@25
MOV RAX,U64 [&cnts.jiffies]
@ -258,7 +258,7 @@ BREAK_FOCUS_USER:
//Do these now, in case interrupt happens.
MOV U64 CTask.wake_jiffy[RSI],0
PUSH RSI
CALL &TaskRstAwaitingMsg
CALL &TaskRstAwaitingMessage
JMP I32 RESTORE_RSI_TASK
END_FOCUS_USER:

View file

@ -464,23 +464,23 @@ U0 KbdHandler()
}
}
I64 KbdMsgsQueue()
I64 KbdMessagesQueue()
{
I64 arg1,arg2,msg_code=MSG_NULL;
I64 arg1,arg2,message_code=MESSAGE_NULL;
CTask *task_focus;
if (task_focus=sys_focus_task) {
while (FifoI64Remove(kbd.scan_code_fifo,&arg2)) {
arg1=ScanCode2Char(arg2);
if (arg2 & SCF_KEY_UP) {
TaskMsg(task_focus,0,MSG_KEY_UP,arg1,arg2,0);
msg_code=MSG_KEY_UP;
TaskMessage(task_focus,0,MESSAGE_KEY_UP,arg1,arg2,0);
message_code=MESSAGE_KEY_UP;
} else {
TaskMsg(task_focus,0,MSG_KEY_DOWN,arg1,arg2,0);
msg_code=MSG_KEY_DOWN;
TaskMessage(task_focus,0,MESSAGE_KEY_DOWN,arg1,arg2,0);
message_code=MESSAGE_KEY_DOWN;
}
}
}
return msg_code;
return message_code;
}
I64 KbdMsEvtTime()

View file

@ -34,11 +34,11 @@ U0 InputFilterTask()
SetRFlags(old_flags);
}
I64 ScanMsg(I64 *_arg1=NULL,I64 *_arg2=NULL,I64 mask=~1,CTask *task=NULL)
I64 ScanMessage(I64 *_arg1=NULL,I64 *_arg2=NULL,I64 mask=~1,CTask *task=NULL)
{/*Check for a message of type specified by a one in the mask.
Throw-out messages not in mask.
If no message fit mask, return NULL immediately.
Remove desired message, return $LK,"msg_code",A="MN:MSG_CMD"$.
Remove desired message, return $LK,"message_code",A="MN:MESSAGE_CMD"$.
Note: This delivers messages from parent down to pop-up.
*/
I64 res,old_flags;
@ -54,52 +54,52 @@ Note: This delivers messages from parent down to pop-up.
if (tmpc==tmpc1)
break;
else {
if (tmpc->job_code==JOBT_MSG) {
if (tmpc->job_code==JOBT_MESSAGE) {
QueueRemove(tmpc);
SetRFlags(old_flags);
res=tmpc->msg_code;
res=tmpc->message_code;
if (_arg1)
*_arg1=tmpc->aux1;
if (_arg2)
*_arg2=tmpc->aux2;
JobDel(tmpc);
if ((res!=MSG_KEY_DOWN || !(tmpc->aux2&SCF_KEY_DESC) ||
if ((res!=MESSAGE_KEY_DOWN || !(tmpc->aux2&SCF_KEY_DESC) ||
!Bt(&task->win_inhibit,WIf_SELF_KEY_DESC)) && Bt(&mask,res))
goto sm_done;
}
}
SetRFlags(old_flags);
}
res=MSG_NULL;
res=MESSAGE_NULL;
if (_arg1)
*_arg1=0;
if (_arg2)
*_arg2=0;
if (task->parent_task&&task->parent_task->popup_task==task) {
SetRFlags(old_flags);
return ScanMsg(_arg1,_arg2,mask,task->parent_task);
return ScanMessage(_arg1,_arg2,mask,task->parent_task);
}
sm_done:
SetRFlags(old_flags);
return res;
}
I64 FlushMsgs(CTask *task=NULL)
I64 FlushMessages(CTask *task=NULL)
{//Throw away all messages. Return count.
I64 res=0,arg1,arg2;
while (ScanMsg(&arg1,&arg2,~1,task))
while (ScanMessage(&arg1,&arg2,~1,task))
res++;
return res;
}
I64 GetMsg(I64 *_arg1=NULL,I64 *_arg2=NULL,I64 mask=~1,CTask *task=NULL)
I64 GetMessage(I64 *_arg1=NULL,I64 *_arg2=NULL,I64 mask=~1,CTask *task=NULL)
{//Wait for a message of type specified by a one in the mask.
//Throw-out all messages not in mask.
//Returns $LK,"msg_code",A="MN:MSG_CMD"$. See $LK,"::/Demo/MsgLoop.HC"$.
//Returns $LK,"message_code",A="MN:MESSAGE_CMD"$. See $LK,"::/Demo/MessageLoop.HC"$.
I64 res;
if (!task) task=Fs;
LBtr(&task->task_flags,TASKf_IDLE);
while (!(res=ScanMsg(_arg1,_arg2,mask,task))) {
while (!(res=ScanMessage(_arg1,_arg2,mask,task))) {
LBts(&task->task_flags,TASKf_IDLE);
Yield;
}
@ -108,25 +108,25 @@ I64 GetMsg(I64 *_arg1=NULL,I64 *_arg2=NULL,I64 mask=~1,CTask *task=NULL)
}
I64 ScanChar()
{//Checks for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ and returns 0 immediately if no key.
//Waits for $LK,"MSG_KEY_UP",A="MN:MSG_KEY_UP"$ of non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key and returns $LK,"ASCII",A="MN:CH_CTRLA"$ if key.
//$LK,"ScanMsg",A="MN:ScanMsg"$() throws away other message types.
{//Checks for $LK,"MESSAGE_KEY_DOWN",A="MN:MESSAGE_KEY_DOWN"$ and returns 0 immediately if no key.
//Waits for $LK,"MESSAGE_KEY_UP",A="MN:MESSAGE_KEY_UP"$ of non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key and returns $LK,"ASCII",A="MN:CH_CTRLA"$ if key.
//$LK,"ScanMessage",A="MN:ScanMessage"$() throws away other message types.
I64 arg1a,arg2a,arg1b,arg2b;
if (!ScanMsg(&arg1a,&arg2a,1<<MSG_KEY_DOWN)||!arg1a)
if (!ScanMessage(&arg1a,&arg2a,1<<MESSAGE_KEY_DOWN)||!arg1a)
return 0;
else
do GetMsg(&arg1b,&arg2b,1<<MSG_KEY_UP);
do GetMessage(&arg1b,&arg2b,1<<MESSAGE_KEY_UP);
while (!arg1b); //Be careful of $LK,"SC_SHIFT",A="MN:SC_SHIFT"$ and $LK,"SC_CTRL",A="MN:SC_CTRL"$, etc.
return arg1a;
}
Bool ScanKey(I64 *_ch=NULL,I64 *_scan_code=NULL,Bool echo=FALSE)
{//Checks for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ and returns FALSE immediately if no key.
{//Checks for $LK,"MESSAGE_KEY_DOWN",A="MN:MESSAGE_KEY_DOWN"$ and returns FALSE immediately if no key.
//Sets $LK,"ASCII",A="MN:CH_CTRLA"$ and $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$.
//Removes key message and returns TRUE.
//$LK,"ScanMsg",A="MN:ScanMsg"$() throws away other message types.
//$LK,"ScanMessage",A="MN:ScanMessage"$() throws away other message types.
I64 ch=0,sc=0;
if (ScanMsg(&ch,&sc,1<<MSG_KEY_DOWN)) {
if (ScanMessage(&ch,&sc,1<<MESSAGE_KEY_DOWN)) {
if (_ch) *_ch=ch;
if (_scan_code) *_scan_code=sc;
if (echo)
@ -140,7 +140,7 @@ Bool ScanKey(I64 *_ch=NULL,I64 *_scan_code=NULL,Bool echo=FALSE)
}
I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE)
{//Waits for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ message and returns $LK,"ASCII",A="MN:CH_CTRLA"$.
{//Waits for $LK,"MESSAGE_KEY_DOWN",A="MN:MESSAGE_KEY_DOWN"$ message and returns $LK,"ASCII",A="MN:CH_CTRLA"$.
//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$.
//$LK,"ScanKey",A="MN:ScanKey"$() throws away other message types.
I64 ch,sc;
@ -163,10 +163,10 @@ I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE)
PUSHFD
CLI
KbdMsHandler(TRUE,FALSE);
KbdMsgsQueue;
KbdMessagesQueue;
POPFD
} else {
LBts(&Fs->task_flags,TASKf_AWAITING_MSG);
LBts(&Fs->task_flags,TASKf_AWAITING_MESSAGE);
Yield;
}
LBtr(&Fs->task_flags,TASKf_IDLE);
@ -190,11 +190,11 @@ I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE)
return ch1;
}
U8 *GetStr(U8 *msg=NULL,U8 *dft=NULL,I64 flags=0)
U8 *GetStr(U8 *message=NULL,U8 *dft=NULL,I64 flags=0)
{//Returns a $LK,"MAlloc",A="MN:MAlloc"$()ed prompted string. See $LK,"Flags",A="MN:GSF_SHIFT_ESC_EXIT"$.
U8 *st;
if (msg)
"" msg,dft;
if (message)
"" message,dft;
st=(*fp_getstr2)(flags);
if (!*st) {
Free(st);

View file

@ -904,7 +904,7 @@ U8 *MStrPrint(U8 *fmt,...)
}
U0 PrintErr(U8 *fmt,...)
{//Print "Err:" and msg in blinking red.
{//Print "Err:" and message in blinking red.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
GetOutOfDollar;
"%,p %,p %,p %,p " ST_ERR_ST "%s",Caller,Caller(2),Caller(3),Caller(4),buf;
@ -912,7 +912,7 @@ U0 PrintErr(U8 *fmt,...)
}
U0 PrintWarn(U8 *fmt,...)
{//Print "Warn:" and msg in blinking red.
{//Print "Warn:" and message in blinking red.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
GetOutOfDollar;
"%,p %,p %,p %,p " ST_WARN_ST "%s",Caller,Caller(2),Caller(3),Caller(4),buf;

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more