mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-06-07 00:04:48 +00:00
SCRN -> Screen, HolyC -> CosmiC
This commit is contained in:
parent
e5f5054bff
commit
7b475b0f90
Binary file not shown.
@ -4,9 +4,9 @@ $WW,1$$FG,5$$TX+CX,"Psalmody Help"$$FG$
|
||||
|
||||
* The clip can be used to cut and paste.
|
||||
|
||||
* $FG,2$Psalmody$FG$ uses $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ files as the song format! See $LK,"::/Apps/Psalmody/Examples/prosper.CC"$. The $FG,2$Psalmody$FG$ program does not fully parse the songs when loading them back in, so changes made outside $FG,2$Psalmody$FG$ will be lost, like if you add graphics.
|
||||
* $FG,2$Psalmody$FG$ uses $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ files as the song format! See $LK,"::/Apps/Psalmody/Examples/prosper.CC"$. The $FG,2$Psalmody$FG$ program does not fully parse the songs when loading them back in, so changes made outside $FG,2$Psalmody$FG$ will be lost, like if you add graphics.
|
||||
|
||||
* The first line of the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can request your reward from God by pressing $FG,2$r$FG$. You can press $FG,2$<DEL>$FG$ to delete songs.
|
||||
* The first line of the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can request your reward from God by pressing $FG,2$r$FG$. You can press $FG,2$<DEL>$FG$ to delete songs.
|
||||
|
||||
* You can take the $LK,"Play",A="MN:Play"$() statements out of a song file and place them in your programs. You can also add a song to a document with $FG,2$<CTRL-l>$FG$, but you should do it after pressing $FG,2$<CTRL-t>$FG$ because the clip-insert in $FG,2$<CTRL-l>$FG$ is screwy. See this $SO,"<Song>",A="4qG5EC4BeGG5qCeFD4sB5G4B5G4qG5EC4BeGG5qCeFD4sB5G4B5GqEeEFqE4BeG5FetC4A5GqFCEeEFqE4BeG5FetC4A5GqFC"$ after pressing $FG,2$<CTRL-t>$FG$, now.
|
||||
|
||||
|
@ -52,7 +52,7 @@ class PsmCtrl
|
||||
PsmNote head;
|
||||
PsmNote clip;
|
||||
CMenuEntry *incomplete_entry,*record_entry;
|
||||
I64 scrn_x,tool;
|
||||
I64 screen_x,tool;
|
||||
PsmNote *cur_note;
|
||||
CDC *dc2;
|
||||
Bool playing;
|
||||
|
@ -146,7 +146,7 @@ U0 PsmRecalcNoteXY()
|
||||
{
|
||||
F64 measure_len=4,measure_left=measure_len;
|
||||
PsmNote *tmpn=psm.head.next;
|
||||
I64 x=8-psm.scrn_x,ona,note,octave;
|
||||
I64 x=8-psm.screen_x,ona,note,octave;
|
||||
while (TRUE) {
|
||||
tmpn->x=x;
|
||||
tmpn->y=50;
|
||||
@ -198,11 +198,11 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
PsmRecalcNoteXY;
|
||||
if (psm.cur_note->x<64) {
|
||||
psm.scrn_x-=128;
|
||||
psm.screen_x-=128;
|
||||
PsmRecalcNoteXY;
|
||||
}
|
||||
if (psm.cur_note->x>=GR_WIDTH-64) {
|
||||
psm.scrn_x+=128;
|
||||
psm.screen_x+=128;
|
||||
PsmRecalcNoteXY;
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@ U0 Psalmody(U8 *dirname="~/Psalmody")
|
||||
if (DocPut) DocPut->flags|=DOCF_FORM;
|
||||
|
||||
MemSet(&psm,0,sizeof(PsmCtrl));
|
||||
psm.scrn_x=0;
|
||||
psm.screen_x=0;
|
||||
psm.head.next=psm.head.last=&psm.head;
|
||||
psm.clip.next=psm.clip.last=&psm.clip;
|
||||
psm.cur_note=&psm.head;
|
||||
@ -586,12 +586,12 @@ mo_got_message:
|
||||
"$$GREEN$$<SHIFT-ESC>$$FG$$ to load it into Psalmody.\n\n"
|
||||
ST_WARN_ST " Graphics and other embelishments\n"
|
||||
"will be lost because Psalmody can't\n"
|
||||
"parse HolyC programs completely.\n");
|
||||
"parse CosmiC programs completely.\n");
|
||||
Free(filename);
|
||||
filename=NULL;
|
||||
JukeBox(dirname,&filename);
|
||||
if (filename) {
|
||||
psm.scrn_x=0;
|
||||
psm.screen_x=0;
|
||||
psm_duration=1.0;
|
||||
psm_octave=4;
|
||||
PsmSongDel(&psm.head);
|
||||
@ -626,7 +626,7 @@ mo_got_message:
|
||||
psm_octave=4;
|
||||
PsmSongDel(&psm.head);
|
||||
psm.cur_note=&psm.head;
|
||||
psm.scrn_x=0;
|
||||
psm.screen_x=0;
|
||||
break;
|
||||
case '\n':
|
||||
if (psm.cur_note!=&psm.head)
|
||||
@ -659,7 +659,7 @@ mo_got_message:
|
||||
goto mo_got_message;
|
||||
}
|
||||
psm.cur_note=tmpn;
|
||||
psm.scrn_x+=tmpn->x-0.33*GR_WIDTH;
|
||||
psm.screen_x+=tmpn->x-0.33*GR_WIDTH;
|
||||
if (PsmHasWords(tmpn->word))
|
||||
"%s",tmpn->word;
|
||||
Sound(tmpn->ona);
|
||||
@ -683,7 +683,7 @@ mo_got_message:
|
||||
tmpn=tmpn->next;
|
||||
}
|
||||
psm.cur_note=&psm.head;
|
||||
psm.scrn_x+=psm.cur_note->x-GR_WIDTH/2;
|
||||
psm.screen_x+=psm.cur_note->x-GR_WIDTH/2;
|
||||
psm.playing=FALSE;
|
||||
PsmMenu(psm_octave);
|
||||
col=0;
|
||||
@ -707,7 +707,7 @@ mo_got_message:
|
||||
psm.record_entry->checked=TRUE;
|
||||
psm_duration=1.0;
|
||||
psm_octave=4;
|
||||
psm.scrn_x=0;
|
||||
psm.screen_x=0;
|
||||
}
|
||||
PsmMenu(psm_octave);
|
||||
col=0;
|
||||
|
@ -72,7 +72,7 @@ CAOT *CompJoin(CCompCtrl *cc,I64 comp_flags,U8 *map_name=NULL,U8 mapfile_drive_l
|
||||
cc->htc.glbl_hash_table->next=Fs->hash_table;
|
||||
cc->htc.hash_table_list=cc->htc.local_hash_table=HashTableNew(16);
|
||||
cc->htc.local_hash_table->next=cc->htc.glbl_hash_table;
|
||||
cc->htc.local_var_list=cc->htc.fun; //HolyC local vars
|
||||
cc->htc.local_var_list=cc->htc.fun; //CosmiC local vars
|
||||
cc->htc.fun=NULL;
|
||||
try {
|
||||
if (comp_flags&CMPF_LEX_FIRST)
|
||||
|
@ -89,7 +89,7 @@ U0 StreamDir()
|
||||
}
|
||||
|
||||
CD2I32 *LexD2I32(CCompCtrl *cc,CD2I32 *p)
|
||||
{//Not HolyC. Sprite-like lex 2D point.
|
||||
{//Not CosmiC. Sprite-like lex 2D point.
|
||||
if (cc->token!='(')
|
||||
LexExcept(cc,"Expecting '(' at ");
|
||||
Lex(cc); //Skip (
|
||||
@ -105,7 +105,7 @@ CD2I32 *LexD2I32(CCompCtrl *cc,CD2I32 *p)
|
||||
}
|
||||
|
||||
CD3I32 *LexD3I32(CCompCtrl *cc,CD3I32 *p)
|
||||
{//Not HolyC. Sprite-like lex 3D point.
|
||||
{//Not CosmiC. Sprite-like lex 3D point.
|
||||
if (cc->token!='(')
|
||||
LexExcept(cc,"Expecting '(' at ");
|
||||
Lex(cc); //Skip (
|
||||
|
Binary file not shown.
@ -251,7 +251,7 @@ $ID,-5$
|
||||
|
||||
|
||||
$FG,5$$TX+CX,"Committee Needed"$$FG$
|
||||
* Make binary tree look-up using FUN_SEG symbol addresses, so we can eliminate fun_seg cache and wall-paper kludge? All HolyC functions and glbl vars would have left-right for address search.
|
||||
* Make binary tree look-up using FUN_SEG symbol addresses, so we can eliminate fun_seg cache and wall-paper kludge? All CosmiC functions and glbl vars would have left-right for address search.
|
||||
|
||||
* Should we get rid of drive mapping. It's ugly.
|
||||
|
||||
@ -336,7 +336,7 @@ $FG,5$$TX+CX,"Inspirational Ideas"$$FG$
|
||||
* Make use of flag potential in $LK,"FilesFind",A="MN:FilesFind"$() and possibly $LK,"DirContextNew",A="MN:DirContextNew"$().
|
||||
* Sort options for $LK,"FilesFind",A="MN:FilesFind"$()?
|
||||
|
||||
* New $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ language features?
|
||||
* New $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ language features?
|
||||
|
||||
* Better $LK,"Debugging",A="HI:Debugging"$?
|
||||
|
||||
@ -406,7 +406,7 @@ $FG,5$$TX+CX,"Uncategorized"$$FG$
|
||||
|
||||
* MOV U8 [RSP+RCX],DL
|
||||
|
||||
* $LK,"gr.scrn_image",A="MN:CGrGlobals"$
|
||||
* $LK,"gr.screen_image",A="MN:CGrGlobals"$
|
||||
>Might want to do ZOOM in U8 graphics and convert screen capture to U8
|
||||
>Might want to rev bit order
|
||||
|
||||
|
Binary file not shown.
@ -29,7 +29,7 @@ _BEEPS::
|
||||
POP RBP
|
||||
RET1 8 //Use special return. Pop one arg off of stack.
|
||||
|
||||
//HolyC return vals are in RAX. This function has no return value.
|
||||
//CosmiC return vals are in RAX. This function has no return value.
|
||||
}
|
||||
|
||||
//_extern binds a asm sym to a function.
|
||||
|
@ -6,7 +6,7 @@ U0 BlkDevRep()
|
||||
//$LK,"ClassRep",A="MN:ClassRep"$() dumps any structure, automatically.
|
||||
ClassRep(&blkdev.blkdevs[i]);
|
||||
//The lastclass arg tells ClassRep the datatype.
|
||||
//lastclass is a language feature of $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$.
|
||||
//lastclass is a language feature of $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$.
|
||||
//See $LK,"::/Demo/LastClass.CC"$.
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -83,7 +83,7 @@ $SP,"<1>",BI=1$
|
||||
|
||||
|
||||
|
||||
#define SCRN_SCALE 512
|
||||
#define SCREEN_SCALE 512
|
||||
#define PLOT_GRID_WIDTH 24
|
||||
#define PLOT_GRID_HEIGHT 24
|
||||
#define MAN_HEIGHT 125
|
||||
@ -110,10 +110,10 @@ U0 CFTransform(CDC *dc,I64 *x,I64 *y,I64 *z)
|
||||
{
|
||||
I64 zz;
|
||||
Mat4x4MulXYZ(dc->r,x,y,z);
|
||||
zz=SCRN_SCALE/3+*z;
|
||||
zz=SCREEN_SCALE/3+*z;
|
||||
if (zz<1) zz=1;
|
||||
*x=SCRN_SCALE/2* *x/zz;
|
||||
*y=SCRN_SCALE/2* (*y+MAN_HEIGHT)/zz;
|
||||
*x=SCREEN_SCALE/2* *x/zz;
|
||||
*y=SCREEN_SCALE/2* (*y+MAN_HEIGHT)/zz;
|
||||
*x+=dc->x;
|
||||
*y+=dc->y;
|
||||
*z+=dc->z;
|
||||
@ -131,8 +131,8 @@ Bool LOSPlot(U8 *,I64 x,I64 y,I64)
|
||||
|
||||
Bool LOS(I64 x1,I64 y1,I64 x2,I64 y2)
|
||||
{//Line of sight
|
||||
return Line(NULL,x1*LOS_SCALE/SCRN_SCALE,y1*LOS_SCALE/SCRN_SCALE,0,
|
||||
x2*LOS_SCALE/SCRN_SCALE,y2*LOS_SCALE/SCRN_SCALE,0,&LOSPlot);
|
||||
return Line(NULL,x1*LOS_SCALE/SCREEN_SCALE,y1*LOS_SCALE/SCREEN_SCALE,0,
|
||||
x2*LOS_SCALE/SCREEN_SCALE,y2*LOS_SCALE/SCREEN_SCALE,0,&LOSPlot);
|
||||
}
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
@ -154,7 +154,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Mat4x4RotX(dc->r,ă/2);
|
||||
DCMat4x4Set(dc,dc->r);
|
||||
|
||||
xh=-man_xx/SCRN_SCALE; yh=-man_yy/SCRN_SCALE; zh=0;
|
||||
xh=-man_xx/SCREEN_SCALE; yh=-man_yy/SCREEN_SCALE; zh=0;
|
||||
Mat4x4MulXYZ(dc->r,&xh,&yh,&zh);
|
||||
Mat4x4TranslationEqu(dc->r,xh,yh,zh);
|
||||
|
||||
@ -162,7 +162,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
s2w=Mat4x4IdentNew(task);
|
||||
Mat4x4RotX(s2w,-ă/2);
|
||||
Mat4x4RotZ(s2w,-man_é-ă/2);
|
||||
xh=0; yh=0; zh=SCRN_SCALE;
|
||||
xh=0; yh=0; zh=SCREEN_SCALE;
|
||||
Mat4x4MulXYZ(s2w,&xh,&yh,&zh);
|
||||
|
||||
//Rotate light source
|
||||
@ -194,12 +194,12 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
x1w=x1h;
|
||||
y1w=y1h;
|
||||
for (i=0;i<PLOT_GRID_WIDTH*4;i++) {
|
||||
xx=x1w/SCRN_SCALE; yy=y1w/SCRN_SCALE;
|
||||
x=xx*SCRN_SCALE-man_xx; y=yy*SCRN_SCALE-man_yy;
|
||||
xx=x1w/SCREEN_SCALE; yy=y1w/SCREEN_SCALE;
|
||||
x=xx*SCREEN_SCALE-man_xx; y=yy*SCREEN_SCALE-man_yy;
|
||||
if (1<=xx<map_width-1 && 1<=yy<map_height-1 &&
|
||||
!LBts(panels_processed_bitmap,yy*map_width+xx)) {
|
||||
if ((c=map[yy*map_width+xx]) &&
|
||||
LOS(xx*SCRN_SCALE+SCRN_SCALE/2,yy*SCRN_SCALE+SCRN_SCALE/2,
|
||||
LOS(xx*SCREEN_SCALE+SCREEN_SCALE/2,yy*SCREEN_SCALE+SCREEN_SCALE/2,
|
||||
man_xx,man_yy)) {
|
||||
if (c==YELLOW)
|
||||
dc->color=DKGRAY;
|
||||
@ -208,62 +208,62 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
poly[0].x=x;
|
||||
poly[0].y=y;
|
||||
poly[0].z=0;
|
||||
poly[1].x=x+SCRN_SCALE;
|
||||
poly[1].x=x+SCREEN_SCALE;
|
||||
poly[1].y=y;
|
||||
poly[1].z=0;
|
||||
poly[2].x=x+SCRN_SCALE;
|
||||
poly[2].y=y+SCRN_SCALE;
|
||||
poly[2].x=x+SCREEN_SCALE;
|
||||
poly[2].y=y+SCREEN_SCALE;
|
||||
poly[2].z=0;
|
||||
poly[3].x=x;
|
||||
poly[3].y=y+SCRN_SCALE;
|
||||
poly[3].y=y+SCREEN_SCALE;
|
||||
poly[3].z=0;
|
||||
GrFillPoly3(dc,4,poly);
|
||||
if (c==GREEN) {
|
||||
x1=x+SCRN_SCALE/2;
|
||||
y1=y+SCRN_SCALE/2;
|
||||
x1=x+SCREEN_SCALE/2;
|
||||
y1=y+SCREEN_SCALE/2;
|
||||
z1=0;
|
||||
DCTransform(dc,&x1,&y1,&z1);
|
||||
if (z1>0)
|
||||
Sprite3Mat4x4B(dc,x+SCRN_SCALE/2,y+SCRN_SCALE/2,0,$IB,"<5>",BI=5$,r3);
|
||||
Sprite3Mat4x4B(dc,x+SCREEN_SCALE/2,y+SCREEN_SCALE/2,0,$IB,"<5>",BI=5$,r3);
|
||||
} else if (c==YELLOW) {
|
||||
x1=x+SCRN_SCALE/2;
|
||||
y1=y+SCRN_SCALE/2;
|
||||
x1=x+SCREEN_SCALE/2;
|
||||
y1=y+SCREEN_SCALE/2;
|
||||
z1=0;
|
||||
DCTransform(dc,&x1,&y1,&z1);
|
||||
if (z1>0)
|
||||
Sprite3Mat4x4B(dc,x+SCRN_SCALE/2,y+SCRN_SCALE/2,0,$IB,"<6>",BI=6$,r3);
|
||||
Sprite3Mat4x4B(dc,x+SCREEN_SCALE/2,y+SCREEN_SCALE/2,0,$IB,"<6>",BI=6$,r3);
|
||||
}
|
||||
|
||||
if (!map[(yy+1)*map_width+xx]) {
|
||||
dc->color=LTGRAY;
|
||||
poly[0].x=x;
|
||||
poly[0].y=y+SCRN_SCALE;
|
||||
poly[0].y=y+SCREEN_SCALE;
|
||||
poly[0].z=0;
|
||||
poly[1].x=x+SCRN_SCALE;
|
||||
poly[1].y=y+SCRN_SCALE;
|
||||
poly[1].x=x+SCREEN_SCALE;
|
||||
poly[1].y=y+SCREEN_SCALE;
|
||||
poly[1].z=0;
|
||||
poly[2].x=x+SCRN_SCALE;
|
||||
poly[2].y=y+SCRN_SCALE;
|
||||
poly[2].z=SCRN_SCALE;
|
||||
poly[2].x=x+SCREEN_SCALE;
|
||||
poly[2].y=y+SCREEN_SCALE;
|
||||
poly[2].z=SCREEN_SCALE;
|
||||
poly[3].x=x;
|
||||
poly[3].y=y+SCRN_SCALE;
|
||||
poly[3].z=SCRN_SCALE;
|
||||
poly[3].y=y+SCREEN_SCALE;
|
||||
poly[3].z=SCREEN_SCALE;
|
||||
GrFillPoly3(dc,4,poly);
|
||||
}
|
||||
if (!map[yy*map_width+xx+1]) {
|
||||
dc->color=WHITE;
|
||||
poly[0].x=x+SCRN_SCALE;
|
||||
poly[0].x=x+SCREEN_SCALE;
|
||||
poly[0].y=y;
|
||||
poly[0].z=0;
|
||||
poly[1].x=x+SCRN_SCALE;
|
||||
poly[1].y=y+SCRN_SCALE;
|
||||
poly[1].x=x+SCREEN_SCALE;
|
||||
poly[1].y=y+SCREEN_SCALE;
|
||||
poly[1].z=0;
|
||||
poly[2].x=x+SCRN_SCALE;
|
||||
poly[2].y=y+SCRN_SCALE;
|
||||
poly[2].z=SCRN_SCALE;
|
||||
poly[3].x=x+SCRN_SCALE;
|
||||
poly[2].x=x+SCREEN_SCALE;
|
||||
poly[2].y=y+SCREEN_SCALE;
|
||||
poly[2].z=SCREEN_SCALE;
|
||||
poly[3].x=x+SCREEN_SCALE;
|
||||
poly[3].y=y;
|
||||
poly[3].z=SCRN_SCALE;
|
||||
poly[3].z=SCREEN_SCALE;
|
||||
GrFillPoly3(dc,4,poly);
|
||||
}
|
||||
if (!map[(yy-1)*map_width+xx]) {
|
||||
@ -271,15 +271,15 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
poly[0].x=x;
|
||||
poly[0].y=y;
|
||||
poly[0].z=0;
|
||||
poly[1].x=x+SCRN_SCALE;
|
||||
poly[1].x=x+SCREEN_SCALE;
|
||||
poly[1].y=y;
|
||||
poly[1].z=0;
|
||||
poly[2].x=x+SCRN_SCALE;
|
||||
poly[2].x=x+SCREEN_SCALE;
|
||||
poly[2].y=y;
|
||||
poly[2].z=SCRN_SCALE;
|
||||
poly[2].z=SCREEN_SCALE;
|
||||
poly[3].x=x;
|
||||
poly[3].y=y;
|
||||
poly[3].z=SCRN_SCALE;
|
||||
poly[3].z=SCREEN_SCALE;
|
||||
GrFillPoly3(dc,4,poly);
|
||||
}
|
||||
if (!map[yy*map_width+xx-1]) {
|
||||
@ -288,14 +288,14 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
poly[0].y=y;
|
||||
poly[0].z=0;
|
||||
poly[1].x=x;
|
||||
poly[1].y=y+SCRN_SCALE;
|
||||
poly[1].y=y+SCREEN_SCALE;
|
||||
poly[1].z=0;
|
||||
poly[2].x=x;
|
||||
poly[2].y=y+SCRN_SCALE;
|
||||
poly[2].z=SCRN_SCALE;
|
||||
poly[2].y=y+SCREEN_SCALE;
|
||||
poly[2].z=SCREEN_SCALE;
|
||||
poly[3].x=x;
|
||||
poly[3].y=y;
|
||||
poly[3].z=SCRN_SCALE;
|
||||
poly[3].z=SCREEN_SCALE;
|
||||
GrFillPoly3(dc,4,poly);
|
||||
}
|
||||
}
|
||||
@ -352,10 +352,10 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
dc->color=LTPURPLE;
|
||||
for (i=0,tmpm=monsters;i<MONSTERS_NUM;i++,tmpm++)
|
||||
if (!tmpm->dead)
|
||||
GrPlot3(dc,2*(tmpm->x/SCRN_SCALE),
|
||||
2*(map_height-1-tmpm->y/SCRN_SCALE),0);
|
||||
GrPlot3(dc,2*(tmpm->x/SCREEN_SCALE),
|
||||
2*(map_height-1-tmpm->y/SCREEN_SCALE),0);
|
||||
dc->color=LTCYAN;
|
||||
GrPlot3(dc,2*(man_xx/SCRN_SCALE),2*(map_height-1-man_yy/SCRN_SCALE),0);
|
||||
GrPlot3(dc,2*(man_xx/SCREEN_SCALE),2*(map_height-1-man_yy/SCREEN_SCALE),0);
|
||||
|
||||
if (tf) {
|
||||
dc->color=LTRED;
|
||||
@ -424,16 +424,16 @@ U0 Init()
|
||||
for (x=0;x<map_width-2;x++)
|
||||
map[(map_height-2-y)*map_width+x+1]=GrPeek(dc,x*MAP_SCALE,y*MAP_SCALE);
|
||||
DCDel(dc);
|
||||
man_xx=(1+MAN_START_X)*SCRN_SCALE;
|
||||
man_yy=(map_height-1-MAN_START_Y)*SCRN_SCALE;
|
||||
man_xx=(1+MAN_START_X)*SCREEN_SCALE;
|
||||
man_yy=(map_height-1-MAN_START_Y)*SCREEN_SCALE;
|
||||
man_é=0;
|
||||
|
||||
for (i=0,tmpm=monsters;i<MONSTERS_NUM;i++,tmpm++) {
|
||||
tmpm->dead=FALSE;
|
||||
do {
|
||||
tmpm->x=RandU64%((map_width-2)*SCRN_SCALE)+SCRN_SCALE;
|
||||
tmpm->y=RandU64%((map_height-2)*SCRN_SCALE)+SCRN_SCALE;
|
||||
} while (!map[(tmpm->y/SCRN_SCALE)*map_width+tmpm->x/SCRN_SCALE]);
|
||||
tmpm->x=RandU64%((map_width-2)*SCREEN_SCALE)+SCREEN_SCALE;
|
||||
tmpm->y=RandU64%((map_height-2)*SCREEN_SCALE)+SCREEN_SCALE;
|
||||
} while (!map[(tmpm->y/SCREEN_SCALE)*map_width+tmpm->x/SCREEN_SCALE]);
|
||||
}
|
||||
monsters_left=MONSTERS_NUM;
|
||||
tf=0;
|
||||
@ -446,7 +446,7 @@ U0 AnimateTask(I64)
|
||||
Monster *tmpm;
|
||||
|
||||
while (TRUE) {
|
||||
dd=0.25*SCRN_SCALE*Sin(tS/2);
|
||||
dd=0.25*SCREEN_SCALE*Sin(tS/2);
|
||||
for (i=0,tmpm=monsters;i<MONSTERS_NUM;i++,tmpm++)
|
||||
if (!tmpm->dead) {
|
||||
x=tmpm->x;
|
||||
@ -455,19 +455,19 @@ U0 AnimateTask(I64)
|
||||
x+=dd;
|
||||
else
|
||||
y+=dd;
|
||||
if (0<=x<=map_width*SCRN_SCALE &&
|
||||
0<=y<=map_height*SCRN_SCALE &&
|
||||
map[(y/SCRN_SCALE)*map_width+x/SCRN_SCALE]) {
|
||||
if (!map[(y/SCRN_SCALE)*map_width+x/SCRN_SCALE+1] &&
|
||||
x-RoundI64(x,SCRN_SCALE)>SCRN_SCALE/2 ||
|
||||
!map[(y/SCRN_SCALE)*map_width+x/SCRN_SCALE-1] &&
|
||||
x-RoundI64(x,SCRN_SCALE)<SCRN_SCALE/2)
|
||||
x=RoundI64(x,SCRN_SCALE)+SCRN_SCALE/2;
|
||||
if (!map[(y/SCRN_SCALE+1)*map_width+x/SCRN_SCALE] &&
|
||||
y-RoundI64(y,SCRN_SCALE)>SCRN_SCALE/2 ||
|
||||
!map[(y/SCRN_SCALE-1)*map_width+x/SCRN_SCALE] &&
|
||||
y-RoundI64(y,SCRN_SCALE)<SCRN_SCALE/2)
|
||||
y=RoundI64(y,SCRN_SCALE)+SCRN_SCALE/2;
|
||||
if (0<=x<=map_width*SCREEN_SCALE &&
|
||||
0<=y<=map_height*SCREEN_SCALE &&
|
||||
map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE]) {
|
||||
if (!map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE+1] &&
|
||||
x-RoundI64(x,SCREEN_SCALE)>SCREEN_SCALE/2 ||
|
||||
!map[(y/SCREEN_SCALE)*map_width+x/SCREEN_SCALE-1] &&
|
||||
x-RoundI64(x,SCREEN_SCALE)<SCREEN_SCALE/2)
|
||||
x=RoundI64(x,SCREEN_SCALE)+SCREEN_SCALE/2;
|
||||
if (!map[(y/SCREEN_SCALE+1)*map_width+x/SCREEN_SCALE] &&
|
||||
y-RoundI64(y,SCREEN_SCALE)>SCREEN_SCALE/2 ||
|
||||
!map[(y/SCREEN_SCALE-1)*map_width+x/SCREEN_SCALE] &&
|
||||
y-RoundI64(y,SCREEN_SCALE)<SCREEN_SCALE/2)
|
||||
y=RoundI64(y,SCREEN_SCALE)+SCREEN_SCALE/2;
|
||||
tmpm->x=x;
|
||||
tmpm->y=y;
|
||||
}
|
||||
@ -497,13 +497,13 @@ U0 SongTask(I64)
|
||||
|
||||
U0 MoveMan(F64 é)
|
||||
{
|
||||
I64 x,y,color,step=SCRN_SCALE/2;
|
||||
I64 x,y,color,step=SCREEN_SCALE/2;
|
||||
do {
|
||||
x=man_xx+step*Cos(é);
|
||||
y=man_yy-step*Sin(é);
|
||||
x=Clamp(x,0,map_width*SCRN_SCALE);
|
||||
y=Clamp(y,0,map_height*SCRN_SCALE);
|
||||
color=map[y/SCRN_SCALE*map_width+x/SCRN_SCALE];
|
||||
x=Clamp(x,0,map_width*SCREEN_SCALE);
|
||||
y=Clamp(y,0,map_height*SCREEN_SCALE);
|
||||
color=map[y/SCREEN_SCALE*map_width+x/SCREEN_SCALE];
|
||||
if (color==DKGRAY || color==GREEN) {
|
||||
man_xx=x;
|
||||
man_yy=y;
|
||||
|
@ -17,17 +17,17 @@ The nice thing about character graphics are the animations.
|
||||
|
||||
U16 map[MAP_HEIGHT][MAP_WIDTH];
|
||||
|
||||
I64 scrn_pix_x,scrn_pix_y;
|
||||
I64 screen_pix_x,screen_pix_y;
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *)
|
||||
{
|
||||
U16 *ptr;
|
||||
I64 i,j,y=scrn_pix_y>>3;
|
||||
I64 i,j,y=screen_pix_y>>3;
|
||||
gr.hide_col=gr.hide_row=TRUE;
|
||||
gr.pan_text_x=7-scrn_pix_x&7;
|
||||
gr.pan_text_y=7-scrn_pix_y&7;
|
||||
gr.pan_text_x=7-screen_pix_x&7;
|
||||
gr.pan_text_y=7-screen_pix_y&7;
|
||||
for (i=0;i<task->win_height;i++) {
|
||||
ptr=&map[y++][scrn_pix_x>>3];
|
||||
ptr=&map[y++][screen_pix_x>>3];
|
||||
for (j=0;j<task->win_width;j++)
|
||||
//By the time you clip to window and handle Fs->scroll_x,Fs->scroll_y,
|
||||
//it is too much trouble to do raw access to gr.text_base like we do
|
||||
@ -66,7 +66,7 @@ U0 ScrollTaskX(I64 sign)
|
||||
{
|
||||
I64 i;
|
||||
for (i=0;i<32;i++) {
|
||||
scrn_pix_x=ClampI64(scrn_pix_x+sign,0,
|
||||
screen_pix_x=ClampI64(screen_pix_x+sign,0,
|
||||
(MAP_WIDTH-TEXT_COLS+1)*FONT_WIDTH);
|
||||
Refresh;
|
||||
}
|
||||
@ -76,7 +76,7 @@ U0 ScrollTaskY(I64 sign)
|
||||
{
|
||||
I64 i;
|
||||
for (i=0;i<32;i++) {
|
||||
scrn_pix_y=ClampI64(scrn_pix_y+sign,0,
|
||||
screen_pix_y=ClampI64(screen_pix_y+sign,0,
|
||||
(MAP_HEIGHT-TEXT_ROWS+2)*FONT_HEIGHT);
|
||||
Refresh;
|
||||
}
|
||||
@ -85,8 +85,8 @@ U0 ScrollTaskY(I64 sign)
|
||||
U0 Init()
|
||||
{
|
||||
I64 i,j,x,y;
|
||||
scrn_pix_x=(MAP_WIDTH-TEXT_COLS)>>1*FONT_WIDTH;
|
||||
scrn_pix_y=(MAP_HEIGHT-TEXT_ROWS)>>1*FONT_HEIGHT;
|
||||
screen_pix_x=(MAP_WIDTH-TEXT_COLS)>>1*FONT_WIDTH;
|
||||
screen_pix_y=(MAP_HEIGHT-TEXT_ROWS)>>1*FONT_HEIGHT;
|
||||
|
||||
MemSetU16(map,CH_WATER+(BLUE<<4+LTBLUE)<<8,MAP_WIDTH*MAP_HEIGHT);
|
||||
for (i=1;i<MAP_WIDTH-1;i++)
|
||||
|
@ -49,10 +49,10 @@ U8 *tiles1[16]={NULL,$IB,"<7>",BI=7$ ,$IB,"<5>",BI=5$ ,NULL,NULL,NULL,NULL,NULL,
|
||||
U8 *tiles2[16]={NULL,$IB,"<8>",BI=8$ ,$IB,"<5>",BI=5$ ,NULL,NULL,NULL,NULL,NULL,
|
||||
$IB,"<6>",BI=6$ ,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
|
||||
|
||||
#define SCRN_SCALE 24
|
||||
#define SCRN_WIDTH 24
|
||||
#define SCRN_HEIGHT 24
|
||||
I64 scrn_x,scrn_y;
|
||||
#define SCREEN_SCALE 24
|
||||
#define SCREEN_WIDTH 24
|
||||
#define SCREEN_HEIGHT 24
|
||||
I64 screen_x,screen_y;
|
||||
|
||||
#define MAP_SCALE 4
|
||||
I64 map_width,map_height;
|
||||
@ -115,32 +115,32 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
//if you did it like $LK,"::/Demo/Games/BigGuns.CC"$
|
||||
//with a $LK,"CDC",A="MN:CDC"$.
|
||||
|
||||
for (y=-SCRN_HEIGHT/2;y<SCRN_HEIGHT/2;y++) {
|
||||
yy=y+scrn_y;
|
||||
for (y=-SCREEN_HEIGHT/2;y<SCREEN_HEIGHT/2;y++) {
|
||||
yy=y+screen_y;
|
||||
if (0<=yy<map_height)
|
||||
for (x=-SCRN_WIDTH/2;x<SCRN_WIDTH/2;x++) {
|
||||
xx=x+scrn_x;
|
||||
for (x=-SCREEN_WIDTH/2;x<SCREEN_WIDTH/2;x++) {
|
||||
xx=x+screen_x;
|
||||
if (0<=xx<map_width) {
|
||||
if ((color=map[yy*map_width+xx]) &&
|
||||
LOS(xx,yy,man_x,man_y)) {
|
||||
if (_tiles[color]) {
|
||||
x1=x*SCRN_SCALE;
|
||||
y1=y*SCRN_SCALE;
|
||||
x1=x*SCREEN_SCALE;
|
||||
y1=y*SCREEN_SCALE;
|
||||
z1=0;
|
||||
DCTransform(dc_t,&x1,&y1,&z1);
|
||||
Sprite3(dc,x1,y1,z1,_tiles[color]);
|
||||
} else {//If no tile defined, do solid color.
|
||||
poly[0].x=x*SCRN_SCALE;
|
||||
poly[0].y=y*SCRN_SCALE;
|
||||
poly[0].x=x*SCREEN_SCALE;
|
||||
poly[0].y=y*SCREEN_SCALE;
|
||||
poly[0].z=0;
|
||||
poly[1].x=(x+1)*SCRN_SCALE-1;
|
||||
poly[1].y=y*SCRN_SCALE;
|
||||
poly[1].x=(x+1)*SCREEN_SCALE-1;
|
||||
poly[1].y=y*SCREEN_SCALE;
|
||||
poly[1].z=0;
|
||||
poly[2].x=(x+1)*SCRN_SCALE;
|
||||
poly[2].y=(y+1)*SCRN_SCALE-1;
|
||||
poly[2].x=(x+1)*SCREEN_SCALE;
|
||||
poly[2].y=(y+1)*SCREEN_SCALE-1;
|
||||
poly[2].z=0;
|
||||
poly[3].x=x*SCRN_SCALE-1;
|
||||
poly[3].y=(y+1)*SCRN_SCALE-1;
|
||||
poly[3].x=x*SCREEN_SCALE-1;
|
||||
poly[3].y=(y+1)*SCREEN_SCALE-1;
|
||||
poly[3].z=0;
|
||||
dc_t->color=color;
|
||||
GrFillPoly3(dc_t,4,poly);
|
||||
@ -150,23 +150,23 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
}
|
||||
}
|
||||
|
||||
for (y=-SCRN_HEIGHT/2;y<SCRN_HEIGHT/2;y++) {
|
||||
yy=y+scrn_y;
|
||||
for (y=-SCREEN_HEIGHT/2;y<SCREEN_HEIGHT/2;y++) {
|
||||
yy=y+screen_y;
|
||||
if (0<=yy<map_height)
|
||||
for (x=-SCRN_WIDTH/2;x<SCRN_WIDTH/2;x++) {
|
||||
xx=x+scrn_x;
|
||||
for (x=-SCREEN_WIDTH/2;x<SCREEN_WIDTH/2;x++) {
|
||||
xx=x+screen_x;
|
||||
if (0<=xx<map_width) {
|
||||
if (!map[yy*map_width+xx]) {
|
||||
if (yy+1<map_height && LOS(xx,yy+1,man_x,man_y)) {
|
||||
x1=x*SCRN_SCALE;
|
||||
y1=y*SCRN_SCALE;
|
||||
x1=x*SCREEN_SCALE;
|
||||
y1=y*SCREEN_SCALE;
|
||||
z1=0;
|
||||
DCTransform(dc_t,&x1,&y1,&z1);
|
||||
Sprite3(dc,x1,y1,z1,$IB,"<9>",BI=9$);
|
||||
}
|
||||
if (xx+1<map_width && LOS(xx+1,yy,man_x,man_y)) {
|
||||
x1=x*SCRN_SCALE;
|
||||
y1=y*SCRN_SCALE;
|
||||
x1=x*SCREEN_SCALE;
|
||||
y1=y*SCREEN_SCALE;
|
||||
z1=0;
|
||||
DCTransform(dc_t,&x1,&y1,&z1);
|
||||
Sprite3(dc,x1,y1,z1,$IB,"<10>",BI=10$);
|
||||
@ -178,8 +178,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
for (i=0,tmpm=monsters;i<MONSTERS_NUM;i++,tmpm++)
|
||||
if (!tmpm->dead && LOS(tmpm->x,tmpm->y,man_x,man_y)) {
|
||||
x1=(tmpm->x-scrn_x)*SCRN_SCALE+SCRN_SCALE/2;
|
||||
y1=(tmpm->y-scrn_y)*SCRN_SCALE+SCRN_SCALE/2;
|
||||
x1=(tmpm->x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
y1=(tmpm->y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
z1=0;
|
||||
DCTransform(dc_t,&x1,&y1,&z1);
|
||||
if (tmpm->dx<0) {
|
||||
@ -190,14 +190,14 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
Sprite3(dc,x1,y1,z1,$IB,"<4>",BI=4$);
|
||||
}
|
||||
|
||||
x1=(man_x-scrn_x)*SCRN_SCALE+SCRN_SCALE/2;
|
||||
y1=(man_y-scrn_y)*SCRN_SCALE+SCRN_SCALE/2;
|
||||
x1=(man_x-screen_x)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
y1=(man_y-screen_y)*SCREEN_SCALE+SCREEN_SCALE/2;
|
||||
z1=0;
|
||||
if (tS-man_attack_t0<0.2) {
|
||||
x1+=Tri(tS-man_attack_t0,0.2)*SCRN_SCALE*man_dx;
|
||||
y1+=Tri(tS-man_attack_t0,0.2)*SCRN_SCALE*man_dy;
|
||||
x1+=Tri(tS-man_attack_t0,0.2)*SCREEN_SCALE*man_dx;
|
||||
y1+=Tri(tS-man_attack_t0,0.2)*SCREEN_SCALE*man_dy;
|
||||
if (man_dy!=1)
|
||||
y1-=Saw(tS-man_attack_t0,0.2)*SCRN_SCALE;
|
||||
y1-=Saw(tS-man_attack_t0,0.2)*SCREEN_SCALE;
|
||||
}
|
||||
DCTransform(dc_t,&x1,&y1,&z1);
|
||||
if (man_dx<0) {
|
||||
@ -268,8 +268,8 @@ U0 Init()
|
||||
man_y=4;
|
||||
man_dx=0;
|
||||
man_dy=0;
|
||||
scrn_x=0;
|
||||
scrn_y=0;
|
||||
screen_x=0;
|
||||
screen_y=0;
|
||||
for (i=0,tmpm=monsters;i<MONSTERS_NUM;i++,tmpm++) {
|
||||
tmpm->dead=FALSE;
|
||||
tmpm->dx=0;
|
||||
@ -368,10 +368,10 @@ U0 DunGen()
|
||||
if (man_x+1<map_width &&
|
||||
map[man_y*map_width+(man_x+1)]==DKGRAY) {
|
||||
man_x++;
|
||||
if (man_x-scrn_x>SCRN_WIDTH/2-3) {
|
||||
scrn_x+=SCRN_WIDTH/2;
|
||||
if (scrn_x+SCRN_WIDTH/2>map_width)
|
||||
scrn_x=map_width-SCRN_WIDTH/2;
|
||||
if (man_x-screen_x>SCREEN_WIDTH/2-3) {
|
||||
screen_x+=SCREEN_WIDTH/2;
|
||||
if (screen_x+SCREEN_WIDTH/2>map_width)
|
||||
screen_x=map_width-SCREEN_WIDTH/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -384,10 +384,10 @@ U0 DunGen()
|
||||
if (man_x-1>=0 &&
|
||||
map[man_y*map_width+(man_x-1)]==DKGRAY) {
|
||||
man_x--;
|
||||
if (man_x-scrn_x<-SCRN_WIDTH/2+3) {
|
||||
scrn_x-=SCRN_WIDTH/2;
|
||||
if (scrn_x-SCRN_WIDTH/2<0)
|
||||
scrn_x=SCRN_WIDTH/2;
|
||||
if (man_x-screen_x<-SCREEN_WIDTH/2+3) {
|
||||
screen_x-=SCREEN_WIDTH/2;
|
||||
if (screen_x-SCREEN_WIDTH/2<0)
|
||||
screen_x=SCREEN_WIDTH/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -400,10 +400,10 @@ U0 DunGen()
|
||||
if (man_y-1>=0 &&
|
||||
map[(man_y-1)*map_width+man_x]==DKGRAY) {
|
||||
man_y--;
|
||||
if (man_y-scrn_y<-SCRN_HEIGHT/2+3) {
|
||||
scrn_y-=SCRN_HEIGHT/2;
|
||||
if (scrn_y-SCRN_HEIGHT/2<0)
|
||||
scrn_y=SCRN_HEIGHT/2;
|
||||
if (man_y-screen_y<-SCREEN_HEIGHT/2+3) {
|
||||
screen_y-=SCREEN_HEIGHT/2;
|
||||
if (screen_y-SCREEN_HEIGHT/2<0)
|
||||
screen_y=SCREEN_HEIGHT/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -416,10 +416,10 @@ U0 DunGen()
|
||||
if (man_y+1<map_height &&
|
||||
map[(man_y+1)*map_width+man_x]==DKGRAY) {
|
||||
man_y++;
|
||||
if (man_y-scrn_y>SCRN_HEIGHT/2-3) {
|
||||
scrn_y+=SCRN_HEIGHT/2;
|
||||
if (scrn_y+SCRN_HEIGHT/2>map_height)
|
||||
scrn_y=map_height-SCRN_HEIGHT/2;
|
||||
if (man_y-screen_y>SCREEN_HEIGHT/2-3) {
|
||||
screen_y+=SCREEN_HEIGHT/2;
|
||||
if (screen_y+SCREEN_HEIGHT/2>map_height)
|
||||
screen_y=map_height-SCREEN_HEIGHT/2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -13,8 +13,8 @@ U0 StadiumGen()
|
||||
DocClear;
|
||||
Type("StadiumBG.DD");
|
||||
"$$CM,0,%d$$",TEXT_ROWS-3;
|
||||
fp_old_update=gr.fp_final_scrn_update; //hide mouse cursor
|
||||
gr.fp_final_scrn_update=NULL;
|
||||
fp_old_update=gr.fp_final_screen_update; //hide mouse cursor
|
||||
gr.fp_final_screen_update=NULL;
|
||||
|
||||
Refresh(2,TRUE);
|
||||
dc2=DCScreenCapture;
|
||||
@ -25,7 +25,7 @@ U0 StadiumGen()
|
||||
DCDel(dc);
|
||||
|
||||
DocCursor(ON);
|
||||
gr.fp_final_scrn_update=fp_old_update;
|
||||
gr.fp_final_screen_update=fp_old_update;
|
||||
DocClear;
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -15,7 +15,7 @@ See $LK,"::/Demo/SubIntAccess.CC"$ for how
|
||||
to access upper or lower 32-bits.
|
||||
|
||||
For a complete list of nonstandard compiler
|
||||
features, see $LK,"::/Doc/HolyC.DD"$.
|
||||
features, see $LK,"::/Doc/CosmiC.DD"$.
|
||||
*/
|
||||
|
||||
U0 Main()
|
||||
@ -69,7 +69,7 @@ place i into a reg, so there is a
|
||||
penalty.
|
||||
|
||||
For a complete list of nonstandard compiler
|
||||
features, see $LK,"::/Doc/HolyC.DD"$.
|
||||
features, see $LK,"::/Doc/CosmiC.DD"$.
|
||||
*/
|
||||
|
||||
"i.u32[0]\t=%X\n",i.u32[0];
|
||||
|
@ -37,7 +37,7 @@ That means no read-modify-writes, too.
|
||||
*/
|
||||
Busy(4000000);
|
||||
|
||||
//ZenithOS has a 4 plane memory duplicate of the screen, $LK,"gr.scrn_image",A="MN:CGrGlobals"$,
|
||||
//ZenithOS has a 4 plane memory duplicate of the screen, $LK,"gr.screen_image",A="MN:CGrGlobals"$,
|
||||
//and only writes actual changes.See $LK,"GrUpdateVGAGraphics",A="MN:GrUpdateVGAGraphics"$().
|
||||
//<CTRL-ALT-v> will flush screen VGA cache.
|
||||
VGAFlush;
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*The ~/Registry.CC file is HolyC code.
|
||||
/*The ~/Registry.CC file is CosmiC code.
|
||||
You can execute a tree branch of it.The Zenith
|
||||
branch is executed in the Zenith task boot phase.
|
||||
Normally, you will place var declarations
|
||||
in the branch you make, but since an arthmetic expression
|
||||
is valid in HolyC you can place simple expressions
|
||||
is valid in CosmiC you can place simple expressions
|
||||
without vars.
|
||||
*/
|
||||
|
||||
|
@ -6,7 +6,7 @@ Here are example inst formats:
|
||||
$HL,1$ ADD RAX,I64 FS:DISP[RSI+RDI*8]
|
||||
$HL,0$$HL,1$ ADD RAX,I64 [DISP]
|
||||
$HL,0$
|
||||
$FG,2$$$$FG$ Current compiler output pos (inst ptr). Even works in HolyC expressions.
|
||||
$FG,2$$$$FG$ Current compiler output pos (inst ptr). Even works in CosmiC expressions.
|
||||
|
||||
$FG,2$$$$FG$ works in $FG,2$class$FG$es.
|
||||
$FG,2$class MyFun
|
||||
|
@ -33,7 +33,7 @@ $ID,-5$
|
||||
|
||||
* There is a limit of 100,000 lines of code for all time, not including applications and demos. $FG,4$Code comments count$FG$, however. Currently, there are $TX,"81,494",D="DD_TEMPLEOS_LOC"$ lines of code. $FG,4$3rd party libraries are banned$FG$ because they circumvent the intent of this limit. The vision is a Commodore 64 ROM -- a fixed core API that is the only dependency of applications. Dependency on components and libraries creates a hell that is no longer blissful.
|
||||
|
||||
* The metric for resolving all ZenithOS code governance issues is how fast the compiler compiles itself and the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). The $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ language should be changed to optimize this metric, as I did when I changed type casting from prefix standard C to postfix $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$, but we need a rule to prevent degenerating into a brainfuck language.
|
||||
* The metric for resolving all ZenithOS code governance issues is how fast the compiler compiles itself and the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). The $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ language should be changed to optimize this metric, as I did when I changed type casting from prefix standard C to postfix $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$, but we need a rule to prevent degenerating into a brainfuck language.
|
||||
|
||||
* Minimal abstraction is a goal. Sheep are fools. They always respect a design that is more complicated than another. Any genius can make it complicated. Like in physics, it takes a supra-genius to make it simple.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
$WW,1$$FG,5$$TX+CX,"Command Line Overview"$$FG$
|
||||
|
||||
The cmd line feeds into the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiler line-by-line as you type. A stmt outside a function executes immediately. Remember to add a semicolon.$WW,1$
|
||||
The cmd line feeds into the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ compiler line-by-line as you type. A stmt outside a function executes immediately. Remember to add a semicolon.$WW,1$
|
||||
|
||||
Look-up the function headers with $FG,2$AutoComplete$FG$ by hitting $FG,2$<CTRL-SHIFT-F1>$FG$ after typing the first few letters.
|
||||
|
||||
|
@ -78,7 +78,7 @@ $ID,2$$WW,0$
|
||||
$FG,2$I64 AddNums(...)
|
||||
{
|
||||
I64 i,res=0;
|
||||
for (i=0;i<argc;i++)
|
||||
for (i=0;i<argc;i++)
|
||||
res+=argv[i];
|
||||
return res;
|
||||
}
|
||||
@ -219,7 +219,7 @@ $FG$$ID,-2$
|
||||
|
||||
* Can't use $FG,2$<>$FG$ with $FG,2$#include$FG$, use $FG,2$""$FG$.
|
||||
|
||||
* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$. In $FG,2$asm$FG$ or $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ code, it also refers to the inst's address or the offset in a $FG,2$class$FG$ definition.
|
||||
* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$. In $FG,2$asm$FG$ or $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ code, it also refers to the inst's address or the offset in a $FG,2$class$FG$ definition.
|
||||
|
||||
* $FG,2$union$FG$ is more like a class, so you don't reference it with a $FG,2$union$FG$ label after you define it. Some common unions are declared in $LK,"KernelA.HH",A="MN:U16"$ for 1,2,4 and 8 byte objects. If you place a type in front of a union declaration, that is the type when used by itself. See $LK,"::/Demo/SubIntAccess.CC"$.
|
||||
|
@ -1,3 +1,3 @@
|
||||
$WW,1$ZenithOS has a class for 3 dimensional points consisting of F64s. HolyC is not C++ -- it does not support passing or returning values from functions which are not 64-bits, therefore, it can't be implemented with operator overloading. Making all function args and returns 64-bit is a core prinicple of ZenithOS.
|
||||
$WW,1$ZenithOS has a class for 3 dimensional points consisting of F64s. CosmiC is not C++ -- it does not support passing or returning values from functions which are not 64-bits, therefore, it can't be implemented with operator overloading. Making all function args and returns 64-bit is a core prinicple of ZenithOS.
|
||||
|
||||
As a courtesy, most of the CD3 functions return the addr of the destination vect, so you can nestle calls. They do not alloc new space for the destination vect.
|
||||
|
@ -4,7 +4,7 @@ $WW,1$$FG,5$$TX+CX,"Debugging Overview"$$FG$
|
||||
|
||||
* $LK,"U",A="MN:U"$(&FunName+offset) to unassemble mem or $LK,"Uf",A="MN:Uf"$("FunName") to unassemble a function. $LK,"U",A="MN:U"$($LK,"_RIP",A="MN:_RIP"$-16);
|
||||
|
||||
* While debugging, you specify addresses of assembly routines with just the label, as in $FG,2$_MALLOC+0x20$FG$. You specify $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ function names with $FG,2$&$FG$ before functions as in $FG,2$&Print+0x10$FG$.
|
||||
* While debugging, you specify addresses of assembly routines with just the label, as in $FG,2$_MALLOC+0x20$FG$. You specify $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ function names with $FG,2$&$FG$ before functions as in $FG,2$&Print+0x10$FG$.
|
||||
|
||||
* I use $LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ for debugging because they show on the wallpaper. They're just global int vars.
|
||||
|
||||
@ -30,7 +30,7 @@ $WW,1$$FG,5$$TX+CX,"Debugging Overview"$$FG$
|
||||
$ID,2$
|
||||
$LK,"Echo",A="MN:Echo"$() turns on or off raw data going into the lexical analyzer.
|
||||
|
||||
$LK,"Trace",A="MN:Trace"$() unassembles code generated from the HolyC compiler.
|
||||
$LK,"Trace",A="MN:Trace"$() unassembles code generated from the CosmiC compiler.
|
||||
|
||||
$LK,"PassTrace",A="MN:PassTrace"$() shows intermediate code coming-out after optimization. The bits ctrl which passes are displayed.
|
||||
$ID,-2$
|
||||
|
@ -123,29 +123,29 @@ Examples: <CTRL-t> to see
|
||||
$ID,-2$$TR,"BT Bttn"$
|
||||
$ID,2$See $LK,"::/Demo/DolDoc/MenuBttn.CC"$.
|
||||
$ID,-2$$TR,"DA Data"$
|
||||
$ID,2$Used for forms that prompt for data or just displaying a value. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$format$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CC"$, $LK,"::/Demo/Disk/DataBase.CC"$, and $LK,"::/Zenith/DolDoc/DocWidgetWiz.CC"$.
|
||||
$ID,2$Used for forms that prompt for data or just displaying a value. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's $FG,2$format$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CC"$, $LK,"::/Demo/Disk/DataBase.CC"$, and $LK,"::/Zenith/DolDoc/DocWidgetWiz.CC"$.
|
||||
|
||||
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$DA...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Zenith/DolDoc/DocEd.CC,&Fs->task_title"$.
|
||||
|
||||
The default raw data type for the $FG,2$$$DA...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
The default raw data type for the $FG,2$$$DA...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
|
||||
The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the print/scan format string.
|
||||
|
||||
The default field length is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string.
|
||||
The default field length is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string.
|
||||
|
||||
The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Zenith/DolDoc/DocPlain.CC,DataTagWidth"$.
|
||||
$ID,-2$$TR,"CB Check Box"$
|
||||
$ID,2$Used for forms. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$format$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CC"$$FG$ and $LK,"CEdFindText",A="MN:CEdFindText"$.
|
||||
$ID,2$Used for forms. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's $FG,2$format$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CC"$$FG$ and $LK,"CEdFindText",A="MN:CEdFindText"$.
|
||||
|
||||
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$CB...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Zenith/DolDoc/DocEd.CC,&Fs->task_title"$.
|
||||
|
||||
The default raw data type for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
The default raw data type for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
$ID,-2$$TR,"LS List Widget"$
|
||||
$ID,2$Used for forms that prompt for data. You must specify a define list, $FG,2$D=""$FG$. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$format$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CC"$.
|
||||
$ID,2$Used for forms that prompt for data. You must specify a define list, $FG,2$D=""$FG$. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's $FG,2$format$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.CC"$.
|
||||
|
||||
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$LS...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the data addr. See $LK,"task_title",A="FF:::/Zenith/DolDoc/DocEd.CC,&Fs->task_title"$.
|
||||
|
||||
The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFormat",A="MN:DocDataFormat"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
|
||||
$ID,-2$$TR,"MA Macro"$
|
||||
$ID,2$A left macro arg, $FG,2$LM=""$FG$, will send text when the left mouse is clicked.
|
||||
|
||||
@ -224,7 +224,7 @@ $ID,-2$
|
||||
$TR,"T=\"\" Tag Str"$
|
||||
$ID,2$Some cmds have a tag by default. See $LK,"TX+T",A="FF:::/Zenith/DolDoc/DocInit.CC,TX+T"$. You can code $FG,2$T="tag_text"$FG$ as just $FG,2$"tag_text"$FG$ with no $FG,2$T=$FG$.
|
||||
$ID,-2$$TR,"LEN=\"\" Field Length"$
|
||||
$ID,2$The default field length for $FG,2$$$DA...$$$FG$ commands is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string.
|
||||
$ID,2$The default field length for $FG,2$$$DA...$$$FG$ commands is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string.
|
||||
|
||||
The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Zenith/DolDoc/DocPlain.CC,DataTagWidth"$.
|
||||
$ID,-2$$TR,"A=\"\" Auxilliary Str"$
|
||||
|
@ -21,7 +21,7 @@ $ID,2$$LK,"Bt",A="MN:Bt"$() is $FG,2$bit test$FG$, like the $FG,2$x86$FG$ inst,
|
||||
$ID,-2$$TR,"Is 'Fs->' in the code file system?"$
|
||||
$ID,2$$LK,"Fs",A="MN:Fs"$ is a segment reg, not $FG,2$file system$FG$. ($LK,"Fs",A="MN:Fs"$ is kept pointing to the current task's record.) There is no memory segmentation. It is 64-bit and flat. FS and GS are used as general purpose regs, more or less.
|
||||
$ID,-2$$TR,"Is it Pascal?"$
|
||||
$ID,2$ZenithOS uses a dialect of C/C++ called $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. It is not $FG,2$Pascal$FG$. I altered the syntax making parenthesis optional on function calls with no paramaters.
|
||||
$ID,2$ZenithOS uses a dialect of C/C++ called $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$. It is not $FG,2$Pascal$FG$. I altered the syntax making parenthesis optional on function calls with no paramaters.
|
||||
$ID,-2$$TR,"Why doesn't Sleep() make my laptop hibernate?"$
|
||||
$ID,2$$LK,"Sleep",A="MN:Sleep"$() makes a program pause. It is not hibernation for a laptop.
|
||||
$ID,-2$$TR,"What is Yield() for in loops?"$
|
||||
@ -73,7 +73,7 @@ $ID,2$Binary executable files have export syms which are loaded into the sym tab
|
||||
$ID,-2$$TR,"Why doesn't assert work?"$
|
||||
$ID,2$$FG,2$#assert$FG$ might print a message at COMPILE time, not run time.
|
||||
$ID,-2$$TR,"Why doesn't C++ public work?"$
|
||||
$ID,2$The word $FG,2$public$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ does very little except allow the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$ and $LK,"Who",A="MN:Who"$() to exclude meaningless syms. If you wish a full report of public and nonpublic syms $MA-X+PU,"Click Here",LM="DocMax(1000000);Who;View;\n"$.
|
||||
$ID,2$The word $FG,2$public$FG$ in $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ does very little except allow the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$ and $LK,"Who",A="MN:Who"$() to exclude meaningless syms. If you wish a full report of public and nonpublic syms $MA-X+PU,"Click Here",LM="DocMax(1000000);Who;View;\n"$.
|
||||
$ID,-2$$TR,"How does the debugger do source debugging?"$
|
||||
$ID,2$When compilation takes place, the structures used by the compiler stick around. Data on classes can be accessed. See $LK,"ClassRep",A="MN:ClassRep"$().
|
||||
$ID,-2$$TR,"What are the ASCII 5 and ASCII 31 chars doing in my text files?"$
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
* Free, $FG,2$public domain$FG$, $FG,2$100% open source$FG$.
|
||||
|
||||
* 64-bit $FG,2$compiler/assembler$FG$ for $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. Truly compiles, doesn't interpret. $FG,2$Just-in-Time$FG$ and $FG,2$Ahead-of-Time$FG$ compilation. With $FG,2$JIT$FG$, no need for object or exe files.
|
||||
* 64-bit $FG,2$compiler/assembler$FG$ for $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$. Truly compiles, doesn't interpret. $FG,2$Just-in-Time$FG$ and $FG,2$Ahead-of-Time$FG$ compilation. With $FG,2$JIT$FG$, no need for object or exe files.
|
||||
|
||||
* No 32-bit krufty code.
|
||||
|
||||
|
@ -169,8 +169,8 @@ $ID,-2$$TR,"Code and Data Heaps"$
|
||||
$ID,2$ZenithOS uses the asm $FG,2$CALL$FG$ inst, exclusively, and that inst is limited to calling routines $FG,2$+/-2Gig$FG$ from the current code location. To prevent out-of-range issues, I decided to separate code and data, placing all code within the lowest $FG,2$2Gig$FG$ of memory, addresses $FG,2$00000000$FG$-$FG,2$7FFFFFFF$FG$. The compiler and $LK,"Load",A="MN:Load"$()er alloc memory from the code heap to store code and glbl vars, unless the compiler option $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ is used. When programs call $LK,"MAlloc",A="MN:MAlloc"$() is from the data heap, which in not limited in size, except by physical RAM memory. You can alloc from any heap in any task at any time on any core, even making $LK,"independent",A="MN:MemPagAlloc"$ heaps.
|
||||
$ID,-2$$TR,"Parent, Child and PopUp Tasks"$
|
||||
$ID,2$Often a task will $LK,"Spawn",A="MN:Spawn"$() or $LK,"PopUp",A="MN:PopUp"$() a task as a helper. The helper is known as a child Task, though you can $LK,"Spawn",A="MN:Spawn"$ a task and assign it a different parent... like $FG,2$Zenith$FG$. Links are kept as to who's whose child, so when one task is $LK,"Kill",A="MN:Kill"$()ed the child helper tasks die, too. You can get a report of current system tasks with $LK,"TaskRep",A="MN:TaskRep"$(). There is just one window per task, so child tasks are needed for pop-ups.
|
||||
$ID,-2$$TR,"HolyC"$
|
||||
$ID,2$$LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ is more than $FG,2$C$FG$ and less than $FG,2$C++$FG$. It has the default args of $FG,2$C++$FG$ and uses $FG,2$class$FG$ in place of $FG,2$struct$FG$. It uses $FG,2$U0,U8,U16,U32,I64$FG$ and $FG,2$I0,I8,I16,I32,I64$FG$ for signed and unsigned ints. It has different $LK,"operator precedence",A="FF:::/Doc/HolyC.DD,operator precedence"$. It has $FG,2$PASCAL$FG$-like function calls with no parens, but requires an $FG,2$&$FG,2$$FG$ when referring to function addresses.
|
||||
$ID,-2$$TR,"CosmiC"$
|
||||
$ID,2$$LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ is more than $FG,2$C$FG$ and less than $FG,2$C++$FG$. It has the default args of $FG,2$C++$FG$ and uses $FG,2$class$FG$ in place of $FG,2$struct$FG$. It uses $FG,2$U0,U8,U16,U32,I64$FG$ and $FG,2$I0,I8,I16,I32,I64$FG$ for signed and unsigned ints. It has different $LK,"operator precedence",A="FF:::/Doc/CosmiC.DD,operator precedence"$. It has $FG,2$PASCAL$FG$-like function calls with no parens, but requires an $FG,2$&$FG,2$$FG$ when referring to function addresses.
|
||||
$ID,-2$$TR,"AOT Compile Mode"$
|
||||
$ID,2$$FG,2$Ahead-of-Time$FG$ compiling is conventional compilation mode. Do not use $FG,2$AOT$FG$, use $FG,2$JIT$FG$ compiling.
|
||||
|
||||
@ -223,11 +223,11 @@ $FG,5$*.???.C$FG$
|
||||
$FG,5$*.DD;*.DD$FG$
|
||||
Text Files
|
||||
$FG,5$*.CC;*.CC$FG$
|
||||
HolyC src files. The default HolyC compiler type is $FG,2$.CC$FG$.
|
||||
CosmiC src files. The default CosmiC compiler type is $FG,2$.CC$FG$.
|
||||
$FG,5$*.PRJ.Z;*.PRJ$FG$
|
||||
HolyC src files to be compiled $FG,2$AOT$FG$.
|
||||
CosmiC src files to be compiled $FG,2$AOT$FG$.
|
||||
$FG,5$*.HH.Z;*.HH$FG$
|
||||
HolyC src header files.
|
||||
CosmiC src header files.
|
||||
$FG,5$*.MAP;*.MAP$FG$
|
||||
Compiler "map" files
|
||||
$FG,5$*.BIN;*.BIN.C;*.BIN$FG$
|
||||
@ -237,7 +237,7 @@ $FG,5$*.DATA.Z;*.DATA$FG$
|
||||
$FG,5$*.ISO$FG$
|
||||
CD/DVD image file.
|
||||
$FG,5$*.IN.Z;*.IN$FG$
|
||||
$FG,2$InFile$FG$ Basically a HolyC program whose stdout goes to the input of a task when $LK,"InFile",A="MN:InFile"$() is called.
|
||||
$FG,2$InFile$FG$ Basically a CosmiC program whose stdout goes to the input of a task when $LK,"InFile",A="MN:InFile"$() is called.
|
||||
$FG,5$*.GR;*.GR$FG$
|
||||
Graphics file
|
||||
|
||||
@ -253,10 +253,10 @@ $FG,5$ALL_CAPS$FG$
|
||||
Assembly Language labels are capitalized with underscores between words. So are $FG,2$#define$FG$'s.
|
||||
|
||||
$FG,5$_ALL_CAPS$FG$
|
||||
Asm routines which are $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ callable must have a leading underscore.
|
||||
Asm routines which are $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ callable must have a leading underscore.
|
||||
|
||||
$FG,5$MixedCaps$FG$
|
||||
$LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ Functions and class names are MixedCaps.
|
||||
$LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ Functions and class names are MixedCaps.
|
||||
|
||||
$FG,5$lower_case$FG$
|
||||
Local function vars and glbl vars are lower case. Class member names are also lower_case.
|
||||
|
@ -60,7 +60,7 @@ $FG,5$$TX+CX,"Programming Guidelines"$$FG$
|
||||
|
||||
* There are two modes of compiling, $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ and $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$. Compilation is done in both -- neither is "interpreted". Use $FG,2$$LK,"JIT Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$$FG$.
|
||||
|
||||
* $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$
|
||||
* $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$
|
||||
|
||||
* Use $FG,2$I64$FG$ instead of smaller int sizes because the compiler converts everything to 64-bit. Don't use unsigned$FG$ unless it actually breaks. A policy of signed keeps it simple so you don't have to agonize over choices.
|
||||
|
||||
@ -96,9 +96,9 @@ $FG,5$$TX+CX,"Hash Sym Tables"$$FG$
|
||||
|
||||
* See $LK,"::/Zenith/ZHash.CC"$ for examples of how the hash tables are set-up. Basically, syms are placed into hash tables and child process hash tables are chained to parents. This provides scopes for vars and functions.
|
||||
|
||||
* $FG,2$zenith_task->hash_table$FG$ holds the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ syms loaded in on start-up.
|
||||
* $FG,2$zenith_task->hash_table$FG$ holds the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ syms loaded in on start-up.
|
||||
|
||||
* $FG,2$Fs->hash_table$FG$ holds user HolyC syms and if a sym is not found, it checks parents. When a duplicate sym is added to the table, it overshadows the prev sym. When developing software, typically you include the file at the cmd prompt, make changes and reinclude it. Old syms are overshadowed but they are still there. Periodically, kill the TASK and start fresh when mem is low. If you wish your applications to free themselves instead of staying in mem, spawn or $LK,"PopUp",A="MN:PopUp"$() a task to run the application and kill it when it's done.
|
||||
* $FG,2$Fs->hash_table$FG$ holds user CosmiC syms and if a sym is not found, it checks parents. When a duplicate sym is added to the table, it overshadows the prev sym. When developing software, typically you include the file at the cmd prompt, make changes and reinclude it. Old syms are overshadowed but they are still there. Periodically, kill the TASK and start fresh when mem is low. If you wish your applications to free themselves instead of staying in mem, spawn or $LK,"PopUp",A="MN:PopUp"$() a task to run the application and kill it when it's done.
|
||||
|
||||
* To display the contents of a hash table, use the $LK,"Who",A="MN:Who"$() routine or the varients. $LK,"HashDepthRep",A="MN:HashDepthRep"$() gives a histogram of how long the chains are, in case you wish to make hash table sizes bigger.
|
||||
|
||||
@ -114,7 +114,7 @@ See $LK,"::/Doc/Asm.DD"$.
|
||||
|
||||
* Don't change the segment regs unless interrupts are off. It's hard to do, anyway. $LK,"SET_FS_BASE",A="MN:SET_FS_BASE"$ and $LK,"SET_GS_BASE",A="MN:SET_GS_BASE"$.
|
||||
|
||||
* When interacting with $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiled code, preserve $FG,2$RBP, RSI, RDI, R10-R15$FG$ because the compiler uses these for reg vars. You are free to clobber $FG,2$RAX, RBX, RCX, RDX$FG$, $FG,2$R8$FG$ and $FG,2$R9$FG$. See $LK,"Compiler Reg Masks",A="MN:REGG_LOCAL_VARS"$, $LK,"PUSH_C_REGS",A="MN:PUSH_C_REGS"$ and $LK,"POP_C_REGS",A="MN:POP_C_REGS"$
|
||||
* When interacting with $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ compiled code, preserve $FG,2$RBP, RSI, RDI, R10-R15$FG$ because the compiler uses these for reg vars. You are free to clobber $FG,2$RAX, RBX, RCX, RDX$FG$, $FG,2$R8$FG$ and $FG,2$R9$FG$. See $LK,"Compiler Reg Masks",A="MN:REGG_LOCAL_VARS"$, $LK,"PUSH_C_REGS",A="MN:PUSH_C_REGS"$ and $LK,"POP_C_REGS",A="MN:POP_C_REGS"$
|
||||
|
||||
* I recommend using the standard stack frame for functions because $LK,"Caller",A="MN:Caller"$() is used to display the call stack, such as for the wallpaper.
|
||||
$FG,2$ PUSH RBP
|
||||
|
Binary file not shown.
@ -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,"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$.
|
||||
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,"CosmiC",A="FI:::/Doc/CosmiC.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"$.
|
||||
|
||||
|
@ -12,7 +12,7 @@ $WW,1$* You run a risk of problems if you do file operations on the same files s
|
||||
|
||||
* Accessing CD/DVD's is flacky. Try $LK,"Drive",A="MN:Drive"$() or $LK,"DiskChange",A="MN:DiskChange"$() twice.
|
||||
|
||||
* You can only $FG,2$extern$FG$ something once. There is a varient called $FG,2$_extern$FG$ which binds a HolyC definition to a asm sym. This, too, can only be done once.
|
||||
* You can only $FG,2$extern$FG$ something once. There is a varient called $FG,2$_extern$FG$ which binds a CosmiC definition to a asm sym. This, too, can only be done once.
|
||||
|
||||
* A terminal task has a $LK,"CDoc",A="MN:CDoc"$ document structure that remains active even when you change $FG,4$Fs->draw_it$FG$. To prevent links in the $LK,"CDoc",A="MN:CDoc"$ from being activated when the user clicks in the window, do one of three things:
|
||||
$ID,2$
|
||||
|
@ -2,4 +2,4 @@ $WW,1$$FG,5$$TX+CX,"Graphic Sprite Resource Help"$$FG$
|
||||
|
||||
A sprite is an ordered list of elements such as lines, rectangles, bitmaps and color changes. In a program's source code, you first $FG,2$make a sprite$FG$ somewhere outside a function. Then, you $FG,2$insert a pointer$FG$ to the sprite as an "*elems" arg when calling $LK,"Sprite",A="MN:Sprite"$() or $LK,"Sprite3",A="MN:Sprite3"$(). See $LK,"Sprites",A="HI:Sprites"$.
|
||||
|
||||
You can create a $FG,2$sprite macro$FG$ on your $LK,"PersonalMenu",A="FI:~/PersonalMenu.DD"$ with a payload of $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ source code to execute when it ESC's back to the cmd line. If you check "Pop-Up", it will spawn a new task and run the payload. A pop-up macro can be placed in any document.
|
||||
You can create a $FG,2$sprite macro$FG$ on your $LK,"PersonalMenu",A="FI:~/PersonalMenu.DD"$ with a payload of $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ source code to execute when it ESC's back to the cmd line. If you check "Pop-Up", it will spawn a new task and run the payload. A pop-up macro can be placed in any document.
|
||||
|
@ -107,9 +107,9 @@ $WW,1$
|
||||
|
||||
* All offspring tasks of a task inherit syms.
|
||||
|
||||
* The $FG,2$sizeof()$FG$ and HolyC structure members can be used in asm blks.
|
||||
* The $FG,2$sizeof()$FG$ and CosmiC structure members can be used in asm blks.
|
||||
|
||||
* Using $FG,2$&i$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ or $FG,2$i.u8[2]$FG$ on a local var, $FG,2$i$FG$, will force it to $FG,2$noreg$FG$.
|
||||
* Using $FG,2$&i$FG$ in $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ or $FG,2$i.u8[2]$FG$ on a local var, $FG,2$i$FG$, will force it to $FG,2$noreg$FG$.
|
||||
|
||||
* Using $FG,2$try$FG$/$FG,2$catch$FG$ in a function will force all local vars to $FG,2$noreg$FG$.
|
||||
|
||||
|
@ -42,7 +42,7 @@ A three bttn mouse is like a leg you cannot put weight on. ZenithOS just does h
|
||||
|
||||
* Whole files are processed almost exclusively, allowing compression.
|
||||
|
||||
* $LK,"One language",A="FI:::/Doc/HolyC.DD"$ and compiler for command-line, scripts, songs, automations and code.
|
||||
* $LK,"One language",A="FI:::/Doc/CosmiC.DD"$ and compiler for command-line, scripts, songs, automations and code.
|
||||
|
||||
* One editor/word processor/browser for the command-line window, source code, documentation browser, dialog forms.
|
||||
|
||||
|
@ -25,7 +25,7 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
|
||||
|
||||
* You can set your local time zone by setting the $LK,"local_time_offset",A="MN:local_time_offset"$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.CC,local_time"$.
|
||||
|
||||
* $FG,2$<CTRL-SHIFT-L>$FG$ in the editor to reindent a $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ function or renumber an asm routine's local labels.
|
||||
* $FG,2$<CTRL-SHIFT-L>$FG$ in the editor to reindent a $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ function or renumber an asm routine's local labels.
|
||||
|
||||
* You can use $FG,2$filter_lines$FG$ in the editor text search form ($FG,2$<CTRL-f>$FG$) to temporarily display just lines near each match. A value of $FG,2$filter lines$FG$ set to $FG,2$5$FG$ will display lines within 5 lines of matches. Then, you can do another find to a different string and achieve a $FG,2$AND$FG$ search. When finished, press $FG,2$<ESC>$FG$.
|
||||
|
||||
@ -145,7 +145,7 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
|
||||
|
||||
* With $FG,2$start$FG$/$FG,2$end$FG$, common trailing code is fast. Common leading code is slow.$FG$
|
||||
|
||||
* The first line of the $MA-X+PU,"Psalmody",LM="#include \"::/Apps/Psalmody/Run\"\n"$ $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$<DEL>$FG$ to delete songs.
|
||||
* The first line of the $MA-X+PU,"Psalmody",LM="#include \"::/Apps/Psalmody/Run\"\n"$ $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.CC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$<DEL>$FG$ to delete songs.
|
||||
|
||||
$FG,8$
|
||||
* "Linux" is a trademark owned by Linus Torvalds.
|
||||
|
@ -49,7 +49,7 @@ $LK,"/Apps/Psalmody/Examples/prosper.CC",A="FI:::/Apps/Psalmody/Examples/prosper
|
||||
|
||||
Two things to know about ZenithOS are that $UL,1$tasks$UL,0$ have $LK,"MAlloc",A="MN:MAlloc"$/$LK,"Free",A="MN:Free"$ heap memory, not applications, and tasks have compiler symbol tables that persist at a scope like environment variables in other operating systems, and the symbols can include functions.
|
||||
|
||||
For other operating systems, I hated learning one language for command line scripts and another for programming. With $FG,2$ZenithOS$FG$, the command line feeds right into the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiler, line by line, and it places code into memory it $LK,"MAlloc",A="MN:MAlloc"$()s. The compiler is paused at the command line, waiting for input. Naturally, you $FG,2$#include$FG$ a program to load it into memory and, usually, start it.
|
||||
For other operating systems, I hated learning one language for command line scripts and another for programming. With $FG,2$ZenithOS$FG$, the command line feeds right into the $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ compiler, line by line, and it places code into memory it $LK,"MAlloc",A="MN:MAlloc"$()s. The compiler is paused at the command line, waiting for input. Naturally, you $FG,2$#include$FG$ a program to load it into memory and, usually, start it.
|
||||
|
||||
During the boot process, many files get $LK,"compiled",A="FI:::/StartOS.CC"$ before you have access to the command line. (Don't worry, booting takes only two seconds.) All the header declarations for the operating system are compiled and are available for use in your programs without needing to $FG,2$#include $FG$them. Everything is truly compiled to native $FG,2$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ machine code, nothing is $FG,2$interpreted$FG$ and there is no $FG,2$byte code$FG$.
|
||||
|
||||
@ -69,7 +69,7 @@ $FG$I didn't like that, so I made parentheses optional on calls with no args and
|
||||
|
||||
The syntax change created an ambiguity when specifying function addresses, like for calling $LK,"QuickSort",A="MN:QuickSort"$(). To resolve it, I made a '$FG,2$&$FG$' required in front of function names when specifying an address of a function, which is better anyway.
|
||||
|
||||
Once I was no longer using standard C/C++ syntax, I decided to change everything I didn't like and call it $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/HolyC.DD,operator precedence"$ rules. It's Biblical! See $LK,"Luke,5:37",A="BF:Luke,5:37"$.
|
||||
Once I was no longer using standard C/C++ syntax, I decided to change everything I didn't like and call it $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/CosmiC.DD,operator precedence"$ rules. It's Biblical! See $LK,"Luke,5:37",A="BF:Luke,5:37"$.
|
||||
|
||||
There are no object files in ZenithOS and, normally, you don't make executable files either, but you can. That's known as $LK,"Ahead-of-Time",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ compilation. Instead, you $LK,"Just in Time",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ compile.
|
||||
|
||||
|
@ -2,7 +2,7 @@ $WW,1$$FG,5$$TX+CX,"DolDoc Widget Help"$$FG$
|
||||
|
||||
$LK,"DolDoc",A="::/Doc/DolDocOverview.DD"$ is a ZenithOS document type.
|
||||
|
||||
$FG,2$"Expression"$FG$ a num or HolyC algebraic term with operators and HolyC syms can be entered.
|
||||
$FG,2$"Expression"$FG$ a num or CosmiC algebraic term with operators and CosmiC syms can be entered.
|
||||
$FG,2$"Macro"$FG$ Most entries can behave like macro entries if you assign them macro strs.
|
||||
$FG,2$"InStr"$FG$ Like a macro except it is an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$. You can't have both an in_str and macro text defined.
|
||||
|
||||
|
@ -9,7 +9,7 @@ ZenithOS is 64-bit and will not run on 32-bit hardware.
|
||||
ZenithOS requires 512 Meg of RAM minimum and can have 256 Gig of RAM or more!
|
||||
|
||||
ZenithOS files are compressed with a nonstandard LZW format and the source
|
||||
code can only be compiled by the ZenithOS compiler because it is HolyC, a
|
||||
code can only be compiled by the ZenithOS compiler because it is CosmiC, a
|
||||
nonstandard C/C++ dialect. You must boot ZenithOS. Then, you can compile it
|
||||
because it is 100% open source and all source present on the distro.
|
||||
|
||||
|
BIN
src/Kernel.BIN.C
BIN
src/Kernel.BIN.C
Binary file not shown.
@ -58,13 +58,13 @@ See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$().
|
||||
OutU8(VGAP_DATA,0x0F); //All planes -- WHITE
|
||||
if (text.raw_flags&RWF_SCROLL && text.raw_col && !row && !col) {
|
||||
//Scroll cached image
|
||||
MemCopy(text.raw_scrn_image,
|
||||
text.raw_scrn_image+GR_WIDTH*FONT_HEIGHT>>3,
|
||||
MemCopy(text.raw_screen_image,
|
||||
text.raw_screen_image+GR_WIDTH*FONT_HEIGHT>>3,
|
||||
GR_WIDTH*(GR_HEIGHT-FONT_HEIGHT)>>3);
|
||||
MemSet(text.raw_scrn_image+GR_WIDTH*(GR_HEIGHT-FONT_HEIGHT)>>3,0,
|
||||
MemSet(text.raw_screen_image+GR_WIDTH*(GR_HEIGHT-FONT_HEIGHT)>>3,0,
|
||||
GR_WIDTH*FONT_HEIGHT>>3);
|
||||
|
||||
MemCopy(text.vga_alias,text.raw_scrn_image,GR_WIDTH*GR_HEIGHT>>3);
|
||||
MemCopy(text.vga_alias,text.raw_screen_image,GR_WIDTH*GR_HEIGHT>>3);
|
||||
text.raw_col-=text.cols;
|
||||
row=text.rows-1;
|
||||
}
|
||||
@ -72,7 +72,7 @@ See also $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$().
|
||||
CLI
|
||||
ptr=ptr1=col+row*GR_WIDTH*FONT_HEIGHT>>3;
|
||||
ptr+=text.vga_alias;
|
||||
ptr1+=text.raw_scrn_image; //Write to cached image as well
|
||||
ptr1+=text.raw_screen_image; //Write to cached image as well
|
||||
ptr2=&text.font[ch&255];
|
||||
for (i=0;i<FONT_HEIGHT;i++) {
|
||||
*ptr=*ptr1=rev_bits_table[*ptr2++];
|
||||
|
@ -137,7 +137,7 @@ U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags)
|
||||
CHashExport *tmpex;
|
||||
U8 *str,*str2;
|
||||
Bool is_fun=FALSE;
|
||||
if (!(flags&PRTF_TRUNCATE))
|
||||
if (!(flags&PRINTF_TRUNCATE))
|
||||
field_len=0;
|
||||
if (addr) {
|
||||
if (str=FunSegCacheFind(addr,&offset)) {
|
||||
@ -153,12 +153,12 @@ U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags)
|
||||
}
|
||||
if (str) {
|
||||
if (offset>0xFFFF) offset=0xFFFF;
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
if (is_fun) {
|
||||
str2=MStrPrint("&%s",str);
|
||||
if (!field_len)
|
||||
StrCopy(buf,str2);
|
||||
else if (flags&PRTF_LEFT_JUSTIFY && StrLen(str2)<field_len)
|
||||
else if (flags&PRINTF_LEFT_JUSTIFY && StrLen(str2)<field_len)
|
||||
StrCopy(buf,str2);
|
||||
else
|
||||
StrPrint(buf,"%*ts",field_len,str2);
|
||||
@ -166,7 +166,7 @@ U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags)
|
||||
} else {
|
||||
if (!field_len)
|
||||
StrCopy(buf,str);
|
||||
else if (flags&PRTF_LEFT_JUSTIFY && StrLen(str)<field_len)
|
||||
else if (flags&PRINTF_LEFT_JUSTIFY && StrLen(str)<field_len)
|
||||
StrCopy(buf,str);
|
||||
else
|
||||
StrPrint(buf,"%*ts",field_len,str);
|
||||
@ -175,7 +175,7 @@ U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags)
|
||||
if (is_fun) {
|
||||
str2=MStrPrint("&%s",str);
|
||||
if (field_len && field_len>7) {
|
||||
if (flags&PRTF_LEFT_JUSTIFY && StrLen(str2)<field_len-7)
|
||||
if (flags&PRINTF_LEFT_JUSTIFY && StrLen(str2)<field_len-7)
|
||||
StrPrint(buf,"%s+0x%04X",str2,offset);
|
||||
else
|
||||
StrPrint(buf,"%*ts+0x%04X",field_len-7,str2,offset);
|
||||
@ -184,7 +184,7 @@ U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags)
|
||||
Free(str2);
|
||||
} else {
|
||||
if (field_len && field_len>7) {
|
||||
if (flags&PRTF_LEFT_JUSTIFY && StrLen(str)<field_len-7)
|
||||
if (flags&PRINTF_LEFT_JUSTIFY && StrLen(str)<field_len-7)
|
||||
StrPrint(buf,"%s+0x%04X",str,offset);
|
||||
else
|
||||
StrPrint(buf,"%*ts+0x%04X",field_len-7,str,offset);
|
||||
@ -195,9 +195,9 @@ U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (flags&PRTF_COMMA)
|
||||
if (flags&PRINTF_COMMA)
|
||||
StrCopy(buf,".");
|
||||
else if (flags&PRTF_TRUNCATE && field_len)
|
||||
else if (flags&PRINTF_TRUNCATE && field_len)
|
||||
StrPrint(buf,"%*tX",field_len,addr);
|
||||
else
|
||||
StrPrint(buf,"%X",addr);
|
||||
|
@ -8,7 +8,7 @@ CDoc *sys_clip_doc;
|
||||
CTask *zenith_task;
|
||||
I64 sys_num_spawned_tasks;
|
||||
|
||||
CTask *sys_winmgr_task,*sys_task_being_scrn_updated;
|
||||
CTask *sys_winmgr_task,*sys_task_being_screen_updated;
|
||||
U8 *rev_bits_table, //Table with U8 bits revd
|
||||
*set_bits_table; //Table with count of set bits in a U8
|
||||
CDate local_time_offset;
|
||||
|
@ -80,7 +80,7 @@ U0 SysGrInit()
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
OutU8(VGAP_DATA,0x0F);
|
||||
MemSet(text.vga_alias,0,GR_WIDTH*GR_HEIGHT>>3);
|
||||
text.raw_scrn_image=CAlloc(GR_WIDTH*GR_HEIGHT/8);
|
||||
text.raw_screen_image=CAlloc(GR_WIDTH*GR_HEIGHT/8);
|
||||
text.border_chars[2] (I64)=0x0908070605040302;
|
||||
text.border_chars[10](U32)=0x0D0C0B0A;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
asm {/* See $LK,"::/Doc/Boot.DD"$.
|
||||
ZenithOS starts in real, calls some BIOS
|
||||
routines, switches to 32 bit, and 64 bit mode
|
||||
and continues in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ at $LK,"KMain",A="MN:KMain"$().
|
||||
and continues in $LK,"CosmiC",A="FI:::/Doc/CosmiC.DD"$ at $LK,"KMain",A="MN:KMain"$().
|
||||
|
||||
The boot loader jumps here in real-mode (16-bit).
|
||||
It actually jumps to the $LK,"CBinFile",A="MN:CBinFile"$ header which is
|
||||
|
@ -445,7 +445,7 @@ U0 TaskDel(CTask *task)
|
||||
I64 TaskEnd()
|
||||
{//Called with irq's off.
|
||||
CTask *task=Fs,*tmpt,*tmpt1;
|
||||
if (task==sys_task_being_scrn_updated) {
|
||||
if (task==sys_task_being_screen_updated) {
|
||||
LBts(&task->task_flags,TASKf_KILL_TASK);
|
||||
return task->next_task;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -59,7 +59,7 @@ extern class CTask;
|
||||
#define eps (0x3CB0000000000000(F64))
|
||||
|
||||
#help_index "Data Types/Simple"
|
||||
/*HolyC union structure is treated as a
|
||||
/*CosmiC union structure is treated as a
|
||||
whole if no member is specified,
|
||||
similar to bit fields.
|
||||
|
||||
@ -592,7 +592,7 @@ class CRAXRBCRCXRDX
|
||||
};
|
||||
|
||||
//Asm callable function pointers.
|
||||
//They work with $LK,"CallExtNum",A="MN:CallExtNum"$() when calling from HolyC.
|
||||
//They work with $LK,"CallExtNum",A="MN:CallExtNum"$() when calling from CosmiC.
|
||||
#define EXT_WIN_TO_TOP 0
|
||||
#define EXT_WIN_FOCUS 1
|
||||
#define EXT_HEAPLOG_MALLOC 2
|
||||
@ -1358,7 +1358,7 @@ class CDocUndo
|
||||
|
||||
#define RECALCt_NORMAL 0x00
|
||||
#define RECALCt_FIND_CURSOR 0x01
|
||||
#define RECALCt_TO_SCRN 0x02
|
||||
#define RECALCt_TO_SCREEN 0x02
|
||||
#define RECALCG_MASK 0xFF
|
||||
|
||||
#define RECALCF_HAS_CURSOR 0x100
|
||||
@ -3072,7 +3072,7 @@ public class CCtrl
|
||||
I64 left,right,top,bottom;
|
||||
|
||||
//screen pix coordinates (derived)
|
||||
I64 scrn_left,scrn_right,scrn_top,scrn_bottom;
|
||||
I64 screen_left,screen_right,screen_top,screen_bottom;
|
||||
|
||||
U8 *state;
|
||||
|
||||
@ -3528,8 +3528,8 @@ public class CSysFixedArea
|
||||
#define SC_F12 0x58
|
||||
#define SC_PAUSE 0x61
|
||||
#define SC_GUI 0xDB
|
||||
#define SC_PRTSCRN1 0xAA
|
||||
#define SC_PRTSCRN2 0xB7
|
||||
#define SC_PRINTSCREEN1 0xAA
|
||||
#define SC_PRINTSCREEN2 0xB7
|
||||
|
||||
#help_index "Char;Debugging/Raw Output;TextBase Layer/Char"
|
||||
//text.raw_flags
|
||||
@ -3541,7 +3541,7 @@ public class CSysFixedArea
|
||||
public class CTextGlobals
|
||||
{
|
||||
I64 raw_col,raw_flags;
|
||||
U8 *raw_scrn_image;
|
||||
U8 *raw_screen_image;
|
||||
I64 rows,cols; //Use TEXT_ROWS,TEXT_COLS
|
||||
U64 *font,*aux_font;
|
||||
U8 *vga_alias,*vga_text_alias;
|
||||
@ -3578,7 +3578,7 @@ public class CTextGlobals
|
||||
#define DCF_LOCATE_NEAREST 0x800
|
||||
#define DCF_DONT_DRAW 0x1000
|
||||
#define DCF_ALIAS 0x2000
|
||||
#define DCF_SCRN_BITMAP 0x4000
|
||||
#define DCF_SCREEN_BITMAP 0x4000
|
||||
#define DCF_FILL_NOT_COLOR 0x8000
|
||||
#define DCF_RECORD_EXTENTS 0x10000
|
||||
#define DCF_ON_TOP 0x20000
|
||||
@ -3866,18 +3866,18 @@ class CProgress
|
||||
};
|
||||
|
||||
#help_index "Char/Operations"
|
||||
#define PRTF_PAD_ZERO 0x001
|
||||
#define PRTF_LEFT_JUSTIFY 0x002
|
||||
#define PRTF_TRUNCATE 0x004
|
||||
#define PRTF_COMMA 0x008
|
||||
#define PRTF_DOLLAR 0x010
|
||||
#define PRTF_SLASH 0x020
|
||||
#define PRTF_QUESTION 0x040
|
||||
#define PRTF_AUX_FMT_NUM 0x080
|
||||
#define PRTF_DECIMAL 0x100
|
||||
#define PRTF_NEG 0x200
|
||||
#define PRTF_NEG_E 0x400
|
||||
#define PRTF_NEG_AUX_FMT_NUM 0x800
|
||||
#define PRINTF_PAD_ZERO 0x001
|
||||
#define PRINTF_LEFT_JUSTIFY 0x002
|
||||
#define PRINTF_TRUNCATE 0x004
|
||||
#define PRINTF_COMMA 0x008
|
||||
#define PRINTF_DOLLAR 0x010
|
||||
#define PRINTF_SLASH 0x020
|
||||
#define PRINTF_QUESTION 0x040
|
||||
#define PRINTF_AUX_FMT_NUM 0x080
|
||||
#define PRINTF_DECIMAL 0x100
|
||||
#define PRINTF_NEG 0x200
|
||||
#define PRINTF_NEG_E 0x400
|
||||
#define PRINTF_NEG_AUX_FMT_NUM 0x800
|
||||
|
||||
#help_index "Misc/Host"
|
||||
//Host Operating System
|
||||
|
@ -704,7 +704,7 @@ public extern U0 UserCmdLine();
|
||||
public _extern _YIELD U0 Yield();
|
||||
public extern CTask *zenith_task;
|
||||
public extern I64 sys_num_spawned_tasks;
|
||||
extern CTask *sys_winmgr_task,*sys_task_being_scrn_updated;
|
||||
extern CTask *sys_winmgr_task,*sys_task_being_screen_updated;
|
||||
|
||||
#help_index "Task/Delay;Time/CPU Cycles"
|
||||
public extern U0 Busy(I64 æS); //Loosely timed
|
||||
|
@ -19,7 +19,7 @@ U0 PutKey(I64 ch=0,I64 sc=0)
|
||||
|
||||
U0 PutChars(U64 ch)
|
||||
{//Output chars. Up to 8 chars in a single U64.
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/CosmiC.DD,DemoCosmiC"$
|
||||
while (ch) {
|
||||
PutKey(ch&255,0);
|
||||
ch>>=8;
|
||||
@ -28,7 +28,7 @@ U0 PutChars(U64 ch)
|
||||
|
||||
U0 PutS(U8 *st)
|
||||
{//Use $LK,"Print",A="MN:Print"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/CosmiC.DD,DemoCosmiC"$
|
||||
I64 ch;
|
||||
U8 *ptr;
|
||||
Bool cont=TRUE;
|
||||
|
@ -291,8 +291,8 @@ U8 *ScanCode2KeyName(I64 sc)
|
||||
case SC_F11: CatPrint(buf,"F11"); break;
|
||||
case SC_F12: CatPrint(buf,"F12"); break;
|
||||
case SC_GUI: CatPrint(buf,"WINDOWS"); break;
|
||||
case SC_PRTSCRN1: CatPrint(buf,"PRTSCRN1"); break;
|
||||
case SC_PRTSCRN2: CatPrint(buf,"PRTSCRN2"); break;
|
||||
case SC_PRINTSCREEN1: CatPrint(buf,"PRINTSCREEN1"); break;
|
||||
case SC_PRINTSCREEN2: CatPrint(buf,"PRINTSCREEN2"); break;
|
||||
}
|
||||
}
|
||||
return StrNew(buf);
|
||||
|
@ -24,9 +24,9 @@ U0 OutStr(U8 *ptr,U8 **_buf,U8 **_dst,I64 len,I64 flags)
|
||||
i=0;
|
||||
else
|
||||
i=StrLen(ptr);
|
||||
if (flags&PRTF_TRUNCATE && i>len)
|
||||
if (flags&PRINTF_TRUNCATE && i>len)
|
||||
i=len;
|
||||
if (flags&PRTF_LEFT_JUSTIFY) {
|
||||
if (flags&PRINTF_LEFT_JUSTIFY) {
|
||||
for (j=0;j<i;j++)
|
||||
SPutChar(_dst,*ptr++,_buf);
|
||||
for (j=0;j<len-i;j++)
|
||||
@ -65,7 +65,7 @@ U8 *MPrintQ(U8 *ptr,I64 flags)
|
||||
while (ch=*ptr++) {
|
||||
switch (ch) {
|
||||
case '$$':
|
||||
if (flags&PRTF_DOLLAR) {
|
||||
if (flags&PRINTF_DOLLAR) {
|
||||
SPutChar(_dst,'\\',_buf);
|
||||
SPutChar(_dst,'d',_buf);
|
||||
} else {
|
||||
@ -75,7 +75,7 @@ U8 *MPrintQ(U8 *ptr,I64 flags)
|
||||
break;
|
||||
case '%':
|
||||
SPutChar(_dst,ch,_buf);
|
||||
if (flags&PRTF_SLASH)
|
||||
if (flags&PRINTF_SLASH)
|
||||
SPutChar(_dst,ch,_buf);
|
||||
break;
|
||||
case '\n':
|
||||
@ -186,7 +186,7 @@ U8 *MPrintq(U8 *ptr,I64 flags)
|
||||
break;
|
||||
case '%':
|
||||
SPutChar(_dst,ch,_buf);
|
||||
if (flags&PRTF_SLASH && ch1=='%')
|
||||
if (flags&PRINTF_SLASH && ch1=='%')
|
||||
ptr++;
|
||||
break;
|
||||
default:
|
||||
@ -237,11 +237,11 @@ to avoid this.
|
||||
if (ch=='%') {
|
||||
flags=0;
|
||||
if (*format=='-') {
|
||||
flags|=PRTF_LEFT_JUSTIFY;
|
||||
flags|=PRINTF_LEFT_JUSTIFY;
|
||||
format++;
|
||||
}
|
||||
if (*format=='0') {
|
||||
flags|=PRTF_PAD_ZERO;
|
||||
flags|=PRINTF_PAD_ZERO;
|
||||
format++;
|
||||
}
|
||||
len=0;
|
||||
@ -264,7 +264,7 @@ to avoid this.
|
||||
throw('StrPrint');
|
||||
dec_len=argv[cur_arg++];
|
||||
}
|
||||
flags|=PRTF_DECIMAL;
|
||||
flags|=PRINTF_DECIMAL;
|
||||
}
|
||||
|
||||
aux_format_num=0;
|
||||
@ -272,16 +272,16 @@ to avoid this.
|
||||
switch (*format) {
|
||||
start:
|
||||
case '$$':
|
||||
flags|=PRTF_DOLLAR;
|
||||
flags|=PRINTF_DOLLAR;
|
||||
break;
|
||||
case '/':
|
||||
flags|=PRTF_SLASH;
|
||||
flags|=PRINTF_SLASH;
|
||||
break;
|
||||
case ',':
|
||||
flags|=PRTF_COMMA;
|
||||
flags|=PRINTF_COMMA;
|
||||
break;
|
||||
case 't':
|
||||
flags|=PRTF_TRUNCATE;
|
||||
flags|=PRINTF_TRUNCATE;
|
||||
break;
|
||||
case 'l': //harmless
|
||||
break;
|
||||
@ -291,10 +291,10 @@ to avoid this.
|
||||
|
||||
case 'h':
|
||||
format++;
|
||||
flags|=PRTF_AUX_FMT_NUM;
|
||||
flags|=PRINTF_AUX_FMT_NUM;
|
||||
if (*format=='?') {
|
||||
format++;
|
||||
flags|=PRTF_QUESTION;
|
||||
flags|=PRINTF_QUESTION;
|
||||
} else {
|
||||
if (*format=='*') {
|
||||
format++;
|
||||
@ -304,11 +304,11 @@ to avoid this.
|
||||
} else {
|
||||
if (*format=='-') {
|
||||
format++;
|
||||
flags|=PRTF_NEG_AUX_FMT_NUM;
|
||||
flags|=PRINTF_NEG_AUX_FMT_NUM;
|
||||
}
|
||||
while ('0'<=*format<='9')
|
||||
aux_format_num=aux_format_num*10+ *format++ -'0';
|
||||
if (flags&PRTF_NEG_AUX_FMT_NUM)
|
||||
if (flags&PRINTF_NEG_AUX_FMT_NUM)
|
||||
aux_format_num=-aux_format_num;
|
||||
}
|
||||
}
|
||||
@ -325,7 +325,7 @@ to avoid this.
|
||||
case 'F':
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
if (flags&PRTF_DOLLAR) {
|
||||
if (flags&PRINTF_DOLLAR) {
|
||||
doc=argv[cur_arg++];
|
||||
old_flags=doc->flags;
|
||||
doc->flags|=DOCF_NO_CURSOR;
|
||||
@ -405,7 +405,7 @@ to avoid this.
|
||||
}
|
||||
break;
|
||||
end:
|
||||
if (!(flags&PRTF_AUX_FMT_NUM))
|
||||
if (!(flags&PRINTF_AUX_FMT_NUM))
|
||||
aux_format_num=1;
|
||||
while (aux_format_num-->0)
|
||||
OutStr(tmp_buf,_buf,_dst,len,flags);
|
||||
@ -434,16 +434,16 @@ to avoid this.
|
||||
throw('StrPrint');
|
||||
m=argv[cur_arg++];
|
||||
if (m(I64)<0) {
|
||||
flags|=PRTF_NEG;
|
||||
flags|=PRINTF_NEG;
|
||||
m=-m;
|
||||
}
|
||||
sp_out_dec:
|
||||
if (flags&PRTF_AUX_FMT_NUM) {
|
||||
if (flags&PRINTF_AUX_FMT_NUM) {
|
||||
if (!len) len=12;
|
||||
d=m;
|
||||
goto sp_out_eng;
|
||||
}
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
comma_format_count=comma_count=3;
|
||||
do {
|
||||
tmp_buf[k++]=ModU64(&m,10)+'0';
|
||||
@ -454,18 +454,18 @@ sp_out_dec:
|
||||
}
|
||||
} while (k<TMP_BUF_LEN-SLOP);
|
||||
sp_out_comma_num:
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
i=1;
|
||||
else
|
||||
i=0;
|
||||
if (len<0)
|
||||
len=0;
|
||||
if (flags&PRTF_TRUNCATE && k+i>len)
|
||||
if (flags&PRINTF_TRUNCATE && k+i>len)
|
||||
k=len-i;
|
||||
if (k<0)
|
||||
k=0;
|
||||
if (flags&PRTF_PAD_ZERO) {
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_PAD_ZERO) {
|
||||
if (flags&PRINTF_NEG)
|
||||
SPutChar(_dst,'-',_buf);
|
||||
comma_count=(len-k-i+comma_format_count-comma_count+1)
|
||||
%(comma_format_count+1)+1;
|
||||
@ -481,7 +481,7 @@ sp_out_comma_num:
|
||||
} else {
|
||||
for (;i<len-k;i++)
|
||||
SPutChar(_dst,CH_SPACE,_buf);
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
SPutChar(_dst,'-',_buf);
|
||||
}
|
||||
} else {
|
||||
@ -490,25 +490,25 @@ sp_out_comma_num:
|
||||
if (!m) break;
|
||||
} while (k<TMP_BUF_LEN-SLOP);
|
||||
sp_out_num:
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
i=1;
|
||||
else
|
||||
i=0;
|
||||
if (len<0)
|
||||
len=0;
|
||||
if (flags&PRTF_TRUNCATE && k+i>len)
|
||||
if (flags&PRINTF_TRUNCATE && k+i>len)
|
||||
k=len-i;
|
||||
if (k<0)
|
||||
k=0;
|
||||
if (flags&PRTF_PAD_ZERO) {
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_PAD_ZERO) {
|
||||
if (flags&PRINTF_NEG)
|
||||
SPutChar(_dst,'-',_buf);
|
||||
for (;i<len-k;i++)
|
||||
SPutChar(_dst,'0',_buf);
|
||||
} else {
|
||||
for (;i<len-k;i++)
|
||||
SPutChar(_dst,CH_SPACE,_buf);
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
SPutChar(_dst,'-',_buf);
|
||||
}
|
||||
}
|
||||
@ -525,26 +525,26 @@ sp_out_num:
|
||||
throw('StrPrint');
|
||||
d=argv[cur_arg++](F64);
|
||||
if (d<0) {
|
||||
flags|=PRTF_NEG;
|
||||
flags|=PRINTF_NEG;
|
||||
d=-d;
|
||||
}
|
||||
|
||||
if (d==ì) {
|
||||
sp_out_inf:
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
i=1;
|
||||
else
|
||||
i=0;
|
||||
k=1;
|
||||
if (len<0)
|
||||
len=0;
|
||||
if (flags&PRTF_TRUNCATE && k+i>len)
|
||||
if (flags&PRINTF_TRUNCATE && k+i>len)
|
||||
k=len-i;
|
||||
if (k<0)
|
||||
k=0;
|
||||
for (;i<len-k;i++)
|
||||
SPutChar(_dst,CH_SPACE,_buf);
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
SPutChar(_dst,'-',_buf);
|
||||
for (i=0;i<k;i++)
|
||||
SPutChar(_dst,'ì',_buf);
|
||||
@ -556,7 +556,7 @@ sp_out_inf:
|
||||
dec_len=0;
|
||||
n=Log10(d);
|
||||
if (i=dec_len) {
|
||||
if (flags&PRTF_COMMA)
|
||||
if (flags&PRINTF_COMMA)
|
||||
i=i-i/4;
|
||||
if (n+i>17) {
|
||||
n+=i-17;
|
||||
@ -573,7 +573,7 @@ sp_out_inf:
|
||||
n=0;
|
||||
|
||||
m=Round(d);
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
comma_count=i&3;
|
||||
while (i-- && k<TMP_BUF_LEN-SLOP) {
|
||||
if (i>2 && !comma_count--) {
|
||||
@ -599,7 +599,7 @@ sp_out_inf:
|
||||
}
|
||||
if (dec_len)
|
||||
tmp_buf[k++]='.';
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
comma_count=3;
|
||||
do {
|
||||
if (n) {
|
||||
@ -626,13 +626,13 @@ sp_out_inf:
|
||||
goto sp_out_num;
|
||||
case 'e':
|
||||
if (!len) len=12;
|
||||
flags|=PRTF_TRUNCATE;
|
||||
flags|=PRINTF_TRUNCATE;
|
||||
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
d=argv[cur_arg++](F64);
|
||||
if (d<0) {
|
||||
flags|=PRTF_NEG;
|
||||
flags|=PRINTF_NEG;
|
||||
d=-d;
|
||||
}
|
||||
if (d==ì) goto sp_out_inf;
|
||||
@ -649,18 +649,18 @@ sp_out_e:
|
||||
n0=n;
|
||||
if (n<0) {
|
||||
n=-n;
|
||||
flags|=PRTF_NEG_E;
|
||||
flags|=PRINTF_NEG_E;
|
||||
} else
|
||||
flags&=~PRTF_NEG_E;
|
||||
flags&=~PRINTF_NEG_E;
|
||||
|
||||
i=3;
|
||||
do tmp_buf[k++]=ModU64(&n,10)+'0';
|
||||
while (n && i--);
|
||||
if (flags&PRTF_NEG_E)
|
||||
if (flags&PRINTF_NEG_E)
|
||||
tmp_buf[k++]='-';
|
||||
tmp_buf[k++]='e';
|
||||
dec_len=len-k-2;
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
dec_len--;
|
||||
|
||||
if (d) {
|
||||
@ -682,12 +682,12 @@ sp_out_e:
|
||||
goto sp_out_f;
|
||||
case 'g':
|
||||
if (!len) len=12;
|
||||
flags|=PRTF_TRUNCATE;
|
||||
flags|=PRINTF_TRUNCATE;
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
d=argv[cur_arg++](F64);
|
||||
if (d<0) {
|
||||
flags|=PRTF_NEG;
|
||||
flags|=PRINTF_NEG;
|
||||
d=-d;
|
||||
}
|
||||
if (d==ì) goto sp_out_inf;
|
||||
@ -701,12 +701,12 @@ sp_out_e:
|
||||
goto sp_out_f;
|
||||
case 'n':
|
||||
if (!len) len=12;
|
||||
flags|=PRTF_TRUNCATE;
|
||||
flags|=PRINTF_TRUNCATE;
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
d=argv[cur_arg++](F64);
|
||||
if (d<0) {
|
||||
flags|=PRTF_NEG;
|
||||
flags|=PRINTF_NEG;
|
||||
d=-d;
|
||||
}
|
||||
sp_out_eng: //Engineering notation
|
||||
@ -719,17 +719,17 @@ sp_out_eng: //Engineering notation
|
||||
|
||||
if (n<0) {
|
||||
n=-n;
|
||||
flags|=PRTF_NEG_E;
|
||||
flags|=PRINTF_NEG_E;
|
||||
}
|
||||
if (flags&PRTF_AUX_FMT_NUM && -24<=n<=24) {
|
||||
if (flags&PRTF_QUESTION) {
|
||||
if (flags&PRTF_NEG_E)
|
||||
if (flags&PRINTF_AUX_FMT_NUM && -24<=n<=24) {
|
||||
if (flags&PRINTF_QUESTION) {
|
||||
if (flags&PRINTF_NEG_E)
|
||||
i=-n/3;
|
||||
else
|
||||
i=n/3;
|
||||
j=0;
|
||||
} else {
|
||||
if (flags&PRTF_NEG_E)
|
||||
if (flags&PRINTF_NEG_E)
|
||||
j=-n-aux_format_num;
|
||||
else
|
||||
j=n-aux_format_num;
|
||||
@ -742,12 +742,12 @@ sp_out_eng: //Engineering notation
|
||||
tmp_buf[k++]=sys_pos_pows_lets[i];
|
||||
else if (len!=0)
|
||||
tmp_buf[k++]=CH_SPACE;
|
||||
if (!(flags&PRTF_DECIMAL)) {
|
||||
if (!(flags&PRINTF_DECIMAL)) {
|
||||
dec_len=len-k-2;
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
dec_len--;
|
||||
if (j>0) {
|
||||
if (flags&PRTF_COMMA)
|
||||
if (flags&PRINTF_COMMA)
|
||||
dec_len-=4*j/3;
|
||||
else
|
||||
dec_len-=j;
|
||||
@ -763,12 +763,12 @@ sp_out_eng: //Engineering notation
|
||||
i=3;
|
||||
do tmp_buf[k++]=ModU64(&n,10)+'0';
|
||||
while (n && i--);
|
||||
if (flags&PRTF_NEG_E)
|
||||
if (flags&PRINTF_NEG_E)
|
||||
tmp_buf[k++]='-';
|
||||
tmp_buf[k++]='e';
|
||||
if (!dec_len) {
|
||||
dec_len=len-k-2;
|
||||
if (flags&PRTF_NEG)
|
||||
if (flags&PRINTF_NEG)
|
||||
dec_len--;
|
||||
d1=d+Pow10I64(-dec_len+1)/2;
|
||||
if (d1>=10) {
|
||||
@ -778,7 +778,7 @@ sp_out_eng: //Engineering notation
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
if (len && dec_len>0 && !(dec_len&3))
|
||||
tmp_buf[k++]=',';
|
||||
dec_len-=dec_len/4;
|
||||
@ -788,7 +788,7 @@ sp_out_eng: //Engineering notation
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
m=argv[cur_arg++];
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
comma_format_count=comma_count=4;
|
||||
do {
|
||||
tmp_buf[k]= m&15 +'0';
|
||||
@ -815,7 +815,7 @@ sp_out_eng: //Engineering notation
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
m=argv[cur_arg++];
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
comma_format_count=comma_count=4;
|
||||
do {
|
||||
tmp_buf[k]= m&15 +'0';
|
||||
@ -843,7 +843,7 @@ sp_out_eng: //Engineering notation
|
||||
if (cur_arg>=argc)
|
||||
throw('StrPrint');
|
||||
m=argv[cur_arg++];
|
||||
if (flags&PRTF_COMMA) {
|
||||
if (flags&PRINTF_COMMA) {
|
||||
comma_format_count=comma_count=4;
|
||||
do {
|
||||
tmp_buf[k++]= m&1 +'0';
|
||||
@ -889,9 +889,9 @@ U8 *CatPrint(U8 *_dst,U8 *format,...)
|
||||
|
||||
U0 Print(U8 *format,...)
|
||||
{//$LK,"Print(\"\") Format Strings",A="FI:::/Doc/Print.DD"$.See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/CosmiC.DD,DemoCosmiC"$
|
||||
U8 *buf=StrPrintJoin(NULL,format,argc,argv);
|
||||
PutS(buf);//Don't use PutS(). $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
PutS(buf);//Don't use PutS(). $LK,"See Print() shortcut.",A="FF:::/Doc/CosmiC.DD,DemoCosmiC"$
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
|
Binary file not shown.
@ -18,15 +18,15 @@ U0 CtrlsUpdate(CTask *task)
|
||||
if (c->update_derived_vals)
|
||||
(*c->update_derived_vals)(c);
|
||||
if (c->flags&CTRLF_BORDER) {
|
||||
c->scrn_left =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH;
|
||||
c->scrn_right =gr.pan_text_x+task->pix_left+c->right-FONT_WIDTH;
|
||||
c->scrn_top =gr.pan_text_y+task->pix_top+c->top-FONT_HEIGHT;
|
||||
c->scrn_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT;
|
||||
c->screen_left =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH;
|
||||
c->screen_right =gr.pan_text_x+task->pix_left+c->right-FONT_WIDTH;
|
||||
c->screen_top =gr.pan_text_y+task->pix_top+c->top-FONT_HEIGHT;
|
||||
c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT;
|
||||
} else {
|
||||
c->scrn_left =gr.pan_text_x+task->pix_left+c->left;
|
||||
c->scrn_right =gr.pan_text_x+task->pix_left+c->right;
|
||||
c->scrn_top =gr.pan_text_y+task->pix_top+c->top;
|
||||
c->scrn_bottom=gr.pan_text_y+task->pix_top+c->bottom;
|
||||
c->screen_left =gr.pan_text_x+task->pix_left+c->left;
|
||||
c->screen_right =gr.pan_text_x+task->pix_left+c->right;
|
||||
c->screen_top =gr.pan_text_y+task->pix_top+c->top;
|
||||
c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom;
|
||||
}
|
||||
c=c->next;
|
||||
}
|
||||
@ -36,8 +36,8 @@ fp_update_ctrls=&CtrlsUpdate;
|
||||
|
||||
Bool CtrlInsideRect(CCtrl *c,I64 x,I64 y)
|
||||
{//screen coordinates
|
||||
if (c->scrn_left<=x<=c->scrn_right &&
|
||||
c->scrn_top<=y<=c->scrn_bottom)
|
||||
if (c->screen_left<=x<=c->screen_right &&
|
||||
c->screen_top<=y<=c->screen_bottom)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
|
@ -40,7 +40,7 @@ I64 PopUpEdFormat()
|
||||
I64 i;
|
||||
CDoc *doc=DocNew;
|
||||
DocPrint(doc,"$$LTBLUE$$$$MU,\"Compile Check\",LE=EF_CMP_CHK$$\n"
|
||||
"$$MU,\"Reindent HolyC Fun (Beware braces in strings.)\","
|
||||
"$$MU,\"Reindent CosmiC Fun (Beware braces in strings.)\","
|
||||
"LE=EF_REINDENT$$\n"
|
||||
"$$MU,\"Renum Asm Local @@ Labels for Fun\",LE=EF_RENUM_ASM$$\n"
|
||||
"$$MU,\"Insert Template Code: Ctrl Slider\",LE=EF_CTRL_SLIDER$$\n"
|
||||
|
@ -277,7 +277,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
|
||||
|
||||
//WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && doc->owning_task!=Fs) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && doc->owning_task!=Fs) {
|
||||
i_jif=counts.jiffies+JIFFY_FREQ/250; //4 mouse
|
||||
while (Bt(&doc->locked_flags,DOClf_LOCKED)) {
|
||||
if (counts.jiffies>=i_jif)
|
||||
@ -302,7 +302,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (win_task)
|
||||
dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
|
||||
break;
|
||||
case RECALCt_TO_SCRN:
|
||||
case RECALCt_TO_SCREEN:
|
||||
if (doc->updates_count++%(ToI64(winmgr.fps/10)+1) &&
|
||||
!Bt(&doc->flags,DOCf_DO_FULL_REFRESH) &&
|
||||
!(doc->flags&DOCF_BWD_MOVEMENT))
|
||||
@ -352,7 +352,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
doc->top_line_num=0;
|
||||
doc->line_start_col=0;
|
||||
recalc_flags&=~RECALCF_HAS_CURSOR;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.default_text_attr=win_task->border_attr;
|
||||
} else {
|
||||
@ -373,7 +373,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
find_cursor=TRUE;
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.default_text_attr=win_task->text_attr;
|
||||
}
|
||||
@ -385,7 +385,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
right ==doc->old_win_right &&
|
||||
doc->cur_entry==doc->old_cur_entry &&
|
||||
doc->cur_col==doc->old_cur_col;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
||||
y_plot_top=y0-scroll_y/FONT_HEIGHT;
|
||||
y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT;
|
||||
if (!(doc->flags&DOCF_BORDER_DOC) &&
|
||||
@ -406,7 +406,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
cur_u8_attr=s->cur_text_attr;
|
||||
if (doc_e==doc->head.next) {
|
||||
doc->flags&=~DOCF_BWD_MOVEMENT;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && full_refresh)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && full_refresh)
|
||||
doc->flags&=~DOCF_HAS_SONG;
|
||||
} else
|
||||
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
||||
@ -554,7 +554,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
for (k=0;k<doc_e->scroll_len;k++) {
|
||||
ch=ptr[(i_jif+k)%j];
|
||||
if (!Bt(char_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@ -574,7 +574,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
@ -593,7 +593,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
hl=DocHighlight(doc_e,ptr,k,tmp_u32_attr);
|
||||
else
|
||||
hl=NULL;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
//Technically we should do this for scrolling_x, too.
|
||||
if (y>y_plot_bottom)
|
||||
@ -647,7 +647,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
StrPrint(buf,"%08tX ",bptr);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@ -669,7 +669,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
StrPrint(buf,"%02tX",*bptr++);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@ -694,7 +694,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
for (j=0;j<k;j++) {
|
||||
ch=*bptr++;
|
||||
if (!Bt(char_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
@ -718,7 +718,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)&&
|
||||
y_plot_top<=y<=y_plot_bottom)
|
||||
TextLenAttr(win_task,x-x0,y-y0,width-(x-x0),cur_u8_attr<<8);
|
||||
@ -779,7 +779,7 @@ rc_adjust_xy:
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
while (x<k) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+CH_SPACE);
|
||||
if (find_cursor) {
|
||||
@ -791,7 +791,7 @@ rc_adjust_xy:
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (y_plot_top<=y<=y_plot_bottom)
|
||||
TextLenStr(win_task,x-x0,y-y0,k,tmp_u32_attr,"");
|
||||
@ -962,7 +962,7 @@ rc_adjust_xy:
|
||||
if (tmpb && dc) {
|
||||
DCReset(dc);
|
||||
dc->flags&=~(DCF_DONT_DRAW|DCF_LOCATE_NEAREST);
|
||||
if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCRN ||
|
||||
if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCREEN ||
|
||||
doc_e->de_flags&DOCEF_DONT_DRAW)
|
||||
dc->flags|=DCF_DONT_DRAW;
|
||||
bptr=tmpb->data;
|
||||
@ -1026,7 +1026,7 @@ rc_adjust_xy:
|
||||
break;
|
||||
case DOCT_SONG:
|
||||
if (sys_focus_task==win_task &&
|
||||
recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->aux_str &&
|
||||
(!music.cur_song || StrCompare(music.cur_song,doc_e->aux_str))) {
|
||||
@ -1235,7 +1235,7 @@ rc_skip:
|
||||
doc->col=doc->x+1;
|
||||
|
||||
if (recalc_flags&RECALCF_HAS_CURSOR) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
||||
x=0;
|
||||
y=0;
|
||||
} else {
|
||||
@ -1263,7 +1263,7 @@ rc_skip:
|
||||
doc->line_start_col=doc->x+x;
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
recalc_flags&RECALCF_HAS_CURSOR) {
|
||||
x=doc->x-doc->line_start_col+left +scroll_x/FONT_WIDTH;
|
||||
y=doc->y-doc->top_line_num+top+scroll_y/FONT_HEIGHT;
|
||||
|
@ -203,11 +203,11 @@ U0 DocUpdateTaskDocs(CTask *task)
|
||||
task->border_attr=DriveTextAttrGet(*doc->filename.name);
|
||||
if (task->title_src==TTS_ED_FILENAME)
|
||||
MemCopy(task->task_title,doc->filename.name,STR_LEN-1);
|
||||
DocRecalc(doc,RECALCt_TO_SCRN|RECALCF_HAS_CURSOR);
|
||||
DocRecalc(doc,RECALCt_TO_SCREEN|RECALCF_HAS_CURSOR);
|
||||
}
|
||||
if ((doc=DocBorder(task)) && !(doc->flags&DOCF_DONT_SHOW)) {
|
||||
WinScrollNull(task,&saved_scroll);
|
||||
DocRecalc(doc,RECALCt_TO_SCRN);
|
||||
DocRecalc(doc,RECALCt_TO_SCREEN);
|
||||
WinScrollRestore(task,&saved_scroll);
|
||||
}
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
CColorROPU32 color,c,old_color;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@ -96,7 +96,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
h1=0;
|
||||
w2=img->width;
|
||||
h2=img->height;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
@ -105,7 +105,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
if (dist<=dc->nearest_dist)
|
||||
dc->nearest_dist=dist;
|
||||
}
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
w2=win_task->pix_right+1-x;
|
||||
@ -161,7 +161,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
case ROPB_MONO:
|
||||
color_mask=gr.to_8_colors[color.c0.color];
|
||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@ -269,7 +269,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
}
|
||||
} else {
|
||||
k=h1*img->width_internal;
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
for (j=h1;j<h2;j++) {
|
||||
for (i=w1;i<w2;i++)
|
||||
if (img->body[k+i])
|
||||
@ -314,7 +314,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
break;
|
||||
case ROPB_EQU:
|
||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@ -419,7 +419,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
} else {
|
||||
here1a:
|
||||
k=h1*img->width_internal;
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
for (j=h1;j<h2;j++) {
|
||||
for (i=w1;i<w2;i++) {
|
||||
c=img->body[k+i];
|
||||
@ -473,7 +473,7 @@ here1a:
|
||||
break;
|
||||
case ROPB_XOR:
|
||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@ -621,7 +621,7 @@ public CDC *DCExt(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
|
||||
CTask *win_task;
|
||||
if (x1>x2) SwapI64(&x1,&x2);
|
||||
if (y1>y2) SwapI64(&y1,&y2);
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x1+=win_task->pix_left+win_task->scroll_x;
|
||||
y1+=win_task->pix_top +win_task->scroll_y;
|
||||
@ -698,7 +698,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
CColorROPU32 color,c;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@ -715,7 +715,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
w2=FONT_WIDTH;
|
||||
h2=FONT_HEIGHT;
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
@ -724,7 +724,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
if (dist<=dc->nearest_dist)
|
||||
dc->nearest_dist=dist;
|
||||
}
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
w2=win_task->pix_right+1-x;
|
||||
@ -777,7 +777,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
color_mask=gr.to_8_colors[color.c0.color];
|
||||
k1=x+w1;
|
||||
kk1=(h1+y)*dc->width_internal+k1;
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (leading_pixels) {
|
||||
dst=dc->body+kk1&~7;
|
||||
src=font_ptr;
|
||||
@ -1018,7 +1018,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
Bool dither,probability_dither;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@ -1035,7 +1035,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
w2=w;
|
||||
h2=h;
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
@ -1047,7 +1047,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
if (dist<=dc->nearest_dist)
|
||||
dc->nearest_dist=dist;
|
||||
}
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
w2=win_task->pix_right+1-x;
|
||||
@ -1107,7 +1107,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
}
|
||||
res+=dc->collision_count;
|
||||
} else {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@ -1459,7 +1459,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
Bool not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR);
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@ -1468,7 +1468,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
y3=y;
|
||||
if (x3<0 || y3<0)
|
||||
goto gr_done;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
x3+=win_task->pix_left;
|
||||
y3+=win_task->pix_top;
|
||||
if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
|
||||
@ -1483,7 +1483,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
while (TRUE) {
|
||||
x3=x;
|
||||
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x3<0) break;
|
||||
x3+=win_task->pix_left;
|
||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
||||
@ -1492,7 +1492,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
} else
|
||||
if (!(0<=x3<dc->width))
|
||||
break;
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
x3+=win_task->pix_left;
|
||||
dst=dst2+x3;
|
||||
c=*dst;
|
||||
@ -1526,7 +1526,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
I32 *db2;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@ -1537,7 +1537,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
y3=y;
|
||||
if (x3<0 || y3<0)
|
||||
goto gr_done;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
x3+=win_task->pix_left;
|
||||
y3+=win_task->pix_top;
|
||||
if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
|
||||
@ -1566,7 +1566,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
while (TRUE) {
|
||||
x3=x;
|
||||
if (!(x3&(FONT_WIDTH-1))) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x3<0) break;
|
||||
x3+=win_task->pix_left;
|
||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
||||
@ -1576,7 +1576,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
if (!(0<=x3<dc->width))
|
||||
break;
|
||||
}
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
x3+=win_task->pix_left;
|
||||
|
||||
dst=dst2+x3;
|
||||
@ -1635,7 +1635,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
} else
|
||||
break;
|
||||
}
|
||||
if (dc->flags & DCF_SCRN_BITMAP)
|
||||
if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
*x1=x-1-win_task->scroll_x;
|
||||
else
|
||||
*x1=x-1;
|
||||
@ -1643,7 +1643,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
while (TRUE) {
|
||||
x3=x;
|
||||
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (x3<0) break;
|
||||
x3+=win_task->pix_left;
|
||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
||||
@ -1652,7 +1652,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
} else
|
||||
if (!(0<=x3<dc->width))
|
||||
break;
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
x3+=win_task->pix_left;
|
||||
|
||||
dst=dst2+x3;
|
||||
@ -1731,7 +1731,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
return GrRect(dc,x1,y,x2-x1+1,1);
|
||||
}
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x1+=win_task->scroll_x;
|
||||
x2+=win_task->scroll_x;
|
||||
@ -1760,7 +1760,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
} else
|
||||
i=0;
|
||||
j=0;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
x1+=win_task->pix_left;
|
||||
x2+=win_task->pix_left;
|
||||
if (x1>win_task->pix_right)
|
||||
@ -1804,7 +1804,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
if (dc->flags & DCF_DONT_DRAW)
|
||||
goto gr_done;
|
||||
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
||||
char_clear=TRUE;
|
||||
@ -1872,7 +1872,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
db++;
|
||||
z+=dz;
|
||||
if (!(x1&(FONT_WIDTH-1)) && x1<=x2) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP)||
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP)||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
||||
char_clear=TRUE;
|
||||
@ -1900,7 +1900,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
return GrRect(dc,x,y1,1,y2-y1+1);
|
||||
}
|
||||
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x +=win_task->scroll_x;
|
||||
y1+=win_task->scroll_y;
|
||||
@ -1929,7 +1929,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
} else
|
||||
i=0;
|
||||
j=0;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
y1+=win_task->pix_top;
|
||||
y2+=win_task->pix_top;
|
||||
if (y1>win_task->pix_bottom)
|
||||
@ -1973,7 +1973,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
if (dc->flags & DCF_DONT_DRAW)
|
||||
goto gr_done;
|
||||
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||
char_clear=TRUE;
|
||||
@ -2041,7 +2041,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
db+=dc->width_internal;
|
||||
z+=dz;
|
||||
if (!(y1&(FONT_HEIGHT-1)) && y1<=y2) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP)||
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP)||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||
char_clear=TRUE;
|
||||
|
@ -420,10 +420,10 @@ public CDC *DCScreenCapture(Bool include_zoom=TRUE,CTask *task=NULL)
|
||||
U8 *dst;
|
||||
Refresh(0,FALSE);
|
||||
if (include_zoom)
|
||||
dc=DCCopy(gr.scrn_image,task);
|
||||
dc=DCCopy(gr.screen_image,task);
|
||||
else
|
||||
dc=DCCopy(gr.dc1,task);
|
||||
dc->flags&=~DCF_SCRN_BITMAP;
|
||||
dc->flags&=~DCF_SCREEN_BITMAP;
|
||||
dst=MAlloc(dc->width_internal*dc->height,task);
|
||||
//Pick background color that never occurs. COLOR_INVALID
|
||||
GrBitMap4ToBitMap8(dst,dc->body,
|
||||
|
@ -3,7 +3,7 @@
|
||||
public class CGrGlobals
|
||||
{
|
||||
I64 *to_8_bits,*to_8_colors;
|
||||
CDC *scrn_image, //Read only.
|
||||
CDC *screen_image, //Read only.
|
||||
*dc, //Persistent
|
||||
*dc1,
|
||||
*dc2, //Updated every refresh
|
||||
@ -19,7 +19,7 @@ public class CGrGlobals
|
||||
I64 highest_uncovered;
|
||||
U16 *vga_text_cache;
|
||||
I64 pan_text_x,pan_text_y; //[-7,7]
|
||||
U0 (*fp_final_scrn_update)(CDC *dc);//Mouse cursor is handled here.
|
||||
U0 (*fp_final_screen_update)(CDC *dc);//Mouse cursor is handled here.
|
||||
U0 (*fp_wall_paper)(CTask *task);
|
||||
U0 (*fp_draw_mouse)(CDC *dc,I64 x,I64 y);
|
||||
U0 (*fp_draw_grab_mouse)(CDC *dc,I64 x,I64 y,Bool closed);
|
||||
@ -33,9 +33,9 @@ public class CGrGlobals
|
||||
I8 circle_lo[GR_PEN_BRUSHES_NUM][GR_PEN_BRUSHES_NUM],
|
||||
circle_hi[GR_PEN_BRUSHES_NUM][GR_PEN_BRUSHES_NUM];
|
||||
|
||||
#define GR_SCRN_ZOOM_MAX 8
|
||||
U8 *scrn_zoom_tables[GR_SCRN_ZOOM_MAX+1];
|
||||
I64 scrn_zoom,sx,sy;
|
||||
#define GR_SCREEN_ZOOM_MAX 8
|
||||
U8 *screen_zoom_tables[GR_SCREEN_ZOOM_MAX+1];
|
||||
I64 screen_zoom,sx,sy;
|
||||
|
||||
//When zoomed, this keeps the mouse centered.
|
||||
Bool continuous_scroll,
|
||||
|
@ -75,10 +75,10 @@ U0 GrSetUpTables()
|
||||
OutU8(VGAP_DATA,0x0F);
|
||||
//Virtual Box crashes on the following for some reason.
|
||||
// MemSet(text.vga_alias,0,GR_HEIGHT*GR_WIDTH>>3);
|
||||
MemSet(gr.scrn_image->body,0,GR_WIDTH*GR_HEIGHT>>1);
|
||||
MemSet(gr.screen_image->body,0,GR_WIDTH*GR_HEIGHT>>1);
|
||||
}
|
||||
for (i=1;i<=GR_SCRN_ZOOM_MAX;i++) {
|
||||
dst=gr.scrn_zoom_tables[i]=MAlloc(256*i);
|
||||
for (i=1;i<=GR_SCREEN_ZOOM_MAX;i++) {
|
||||
dst=gr.screen_zoom_tables[i]=MAlloc(256*i);
|
||||
for (j=0;j<256;j++) {
|
||||
m=0;
|
||||
for (k=0;k<8;k++) {
|
||||
@ -175,7 +175,7 @@ U0 GrInit2()
|
||||
MemSet(&gr,0,sizeof(CGrGlobals));
|
||||
gr.sprite_hash=HashTableNew(512);
|
||||
HashDefineListAdd("ST_SPRITE_ELEM_CODES",SPHT_ELEM_CODE,gr.sprite_hash);
|
||||
gr.scrn_zoom=1;
|
||||
gr.screen_zoom=1;
|
||||
|
||||
PaletteSetStd;
|
||||
fp_set_std_palette=&PaletteSetStd;
|
||||
@ -191,19 +191,19 @@ U0 GrInit2()
|
||||
gr.win_z_buf=MAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
||||
|
||||
gr.dc2=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
gr.dc2->flags|=DCF_SCRN_BITMAP;
|
||||
gr.dc2->flags|=DCF_SCREEN_BITMAP;
|
||||
gr.dc_cache=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
|
||||
gr.dc=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
gr.dc->flags|=DCF_SCRN_BITMAP|DCF_ON_TOP;
|
||||
gr.dc->flags|=DCF_SCREEN_BITMAP|DCF_ON_TOP;
|
||||
DCFill;
|
||||
|
||||
gr.dc1=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
gr.dc1->flags|=DCF_SCRN_BITMAP;
|
||||
gr.dc1->flags|=DCF_SCREEN_BITMAP;
|
||||
|
||||
gr.scrn_image=DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
|
||||
gr.screen_image=DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
|
||||
gr.zoomed_dc =DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
|
||||
gr.zoomed_dc->flags|=DCF_SCRN_BITMAP;
|
||||
gr.zoomed_dc->flags|=DCF_SCREEN_BITMAP;
|
||||
}
|
||||
|
||||
GrInit2;
|
||||
|
@ -8,7 +8,7 @@ public Bool GrClamp(CDC *dc=gr.dc,I64 *left,I64 *top,I64 *right,I64 *bottom,
|
||||
*top=0;
|
||||
*right=dc->width-1;
|
||||
*bottom=dc->height-1;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
if (GR_WIDTH-1<*right)
|
||||
*right=GR_WIDTH-1;
|
||||
@ -36,7 +36,7 @@ Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2,
|
||||
I64 left,top,right,bottom;
|
||||
CTask *win_task;
|
||||
if (GrClamp(dc,&left,&top,&right,&bottom,width,height)) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
*x1+=win_task->pix_left+win_task->scroll_x;
|
||||
*y1+=win_task->pix_top+win_task->scroll_y;
|
||||
@ -60,7 +60,7 @@ public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
dc->color.c0.rop=ROPB_MONO;
|
||||
GrBlot(dc,x,y,dc->brush);
|
||||
dc->color=old_color;
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@ -91,7 +91,7 @@ Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
else
|
||||
GrBlot(dc,x,y,dc->brush);
|
||||
dc->color=old_color;
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@ -112,7 +112,7 @@ public I64 GrPeek(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
{//2D. Clipping but no transformation.
|
||||
//Returns pix color or -1 if off-screen or covered.
|
||||
CTask *win_task;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@ -512,7 +512,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
}
|
||||
}
|
||||
if (record) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@ -548,7 +548,7 @@ gr_done:
|
||||
Bool GrLinePlot0(CDC *dc,I64 x,I64 y,I64 z)
|
||||
{//This is a callback.
|
||||
CTask *win_task=dc->win_task;
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP ||
|
||||
!IsPixCovered0(win_task,x,y)) {
|
||||
@ -1413,7 +1413,7 @@ public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4)
|
||||
|
||||
min=0;
|
||||
max=dc->height;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
min-=win_task->scroll_y+win_task->pix_top;
|
||||
max-=win_task->scroll_y+win_task->pix_top;
|
||||
@ -1621,7 +1621,7 @@ public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4)
|
||||
|
||||
min=0;
|
||||
max=dc->width;
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
min-=win_task->scroll_x+win_task->pix_left;
|
||||
max-=win_task->scroll_x+win_task->pix_left;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
U0 GrUpdateTaskODEs(CTask *task)
|
||||
{
|
||||
sys_task_being_scrn_updated=task;
|
||||
sys_task_being_screen_updated=task;
|
||||
try
|
||||
ODEsUpdate(task);
|
||||
catch {
|
||||
@ -12,14 +12,14 @@ U0 GrUpdateTaskODEs(CTask *task)
|
||||
Sleep(3000);
|
||||
VGAFlush;
|
||||
}
|
||||
sys_task_being_scrn_updated=NULL;
|
||||
sys_task_being_screen_updated=NULL;
|
||||
}
|
||||
|
||||
U0 GrUpdateTaskWin(CTask *task)
|
||||
{ //Draw a win. Only Core0 tasks have a win.
|
||||
CDC *dc;
|
||||
CD3I64 saved_scroll;
|
||||
sys_task_being_scrn_updated=task;
|
||||
sys_task_being_screen_updated=task;
|
||||
try {
|
||||
if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER))
|
||||
TextBorder(Fs,task->win_left,task->win_right,task->win_top,
|
||||
@ -52,7 +52,7 @@ U0 GrUpdateTaskWin(CTask *task)
|
||||
VGAFlush;
|
||||
}
|
||||
}
|
||||
sys_task_being_scrn_updated=NULL;
|
||||
sys_task_being_screen_updated=NULL;
|
||||
}
|
||||
|
||||
U0 GrUpdateTasks()
|
||||
@ -89,35 +89,35 @@ U0 GrUpdateTasks()
|
||||
winmgr.last_ode_time=winmgr.ode_time;
|
||||
ode_alloced_factor=LowPass1(0.1,ode_alloced_factor,
|
||||
Clamp(Gs->idle_factor-0.1,0.2,0.8),1/winmgr.fps);
|
||||
sys_task_being_scrn_updated=NULL;
|
||||
sys_task_being_screen_updated=NULL;
|
||||
}
|
||||
|
||||
U0 GrFixZoomScale()
|
||||
{
|
||||
gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_SCRN_ZOOM_MAX);
|
||||
if (gr.scrn_zoom==1) {
|
||||
gr.screen_zoom=ClampI64(gr.screen_zoom,1,GR_SCREEN_ZOOM_MAX);
|
||||
if (gr.screen_zoom==1) {
|
||||
gr.sx=0;
|
||||
gr.sy=0;
|
||||
} else {
|
||||
gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.scrn_zoom)&~7;
|
||||
gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.scrn_zoom);
|
||||
gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.screen_zoom)&~7;
|
||||
gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.screen_zoom);
|
||||
}
|
||||
}
|
||||
|
||||
public U0 GrScaleZoom(F64 scale)
|
||||
{//Multiply zoom factor larger or smaller.
|
||||
F64 s=gr.scrn_zoom;
|
||||
gr.scrn_zoom=gr.scrn_zoom*scale;
|
||||
F64 s=gr.screen_zoom;
|
||||
gr.screen_zoom=gr.screen_zoom*scale;
|
||||
GrFixZoomScale;
|
||||
s/=gr.scrn_zoom;
|
||||
s/=gr.screen_zoom;
|
||||
mouse.scale.x*=s;
|
||||
mouse.scale.y*=s;
|
||||
mouse.scale.z*=s;
|
||||
mouse.offset.x=mouse.pos.x-(mouse.pos.x-mouse.offset.x)*s;
|
||||
mouse.offset.y=mouse.pos.y-(mouse.pos.y-mouse.offset.y)*s;
|
||||
mouse.offset.z=mouse.pos.z-(mouse.pos.z-mouse.offset.z)*s;
|
||||
gr.sx=mouse.pos.x-gr.zoomed_dc->width >>1/gr.scrn_zoom;
|
||||
gr.sy=mouse.pos.y-gr.zoomed_dc->height>>1/gr.scrn_zoom;
|
||||
gr.sx=mouse.pos.x-gr.zoomed_dc->width >>1/gr.screen_zoom;
|
||||
gr.sy=mouse.pos.y-gr.zoomed_dc->height>>1/gr.screen_zoom;
|
||||
GrFixZoomScale;
|
||||
}
|
||||
|
||||
@ -125,26 +125,26 @@ U0 GrZoomInScreen()
|
||||
{
|
||||
GrFixZoomScale;
|
||||
I64 plane,row,col,k,l,
|
||||
d2=gr.zoomed_dc->width>>3/gr.scrn_zoom,
|
||||
d2=gr.zoomed_dc->width>>3/gr.screen_zoom,
|
||||
d4=gr.zoomed_dc->width_internal>>3,
|
||||
d5=d4-d2*gr.scrn_zoom,
|
||||
d3=gr.zoomed_dc->height/gr.scrn_zoom,
|
||||
d5=d4-d2*gr.screen_zoom,
|
||||
d3=gr.zoomed_dc->height/gr.screen_zoom,
|
||||
d6=(gr.zoomed_dc->height-d3)*gr.dc1->width_internal>>3,
|
||||
d7=gr.zoomed_dc->height%gr.scrn_zoom*d4;
|
||||
U8 *src,*src2,*dst,*src3,*map=gr.scrn_zoom_tables[gr.scrn_zoom];
|
||||
d7=gr.zoomed_dc->height%gr.screen_zoom*d4;
|
||||
U8 *src,*src2,*dst,*src3,*map=gr.screen_zoom_tables[gr.screen_zoom];
|
||||
|
||||
src=gr.dc1->body+gr.sx>>3+gr.sy*gr.dc1->width_internal>>3;
|
||||
dst=gr.zoomed_dc->body;
|
||||
for (plane=1;plane<0x10;plane<<=1) {
|
||||
row=d3;
|
||||
while (row--) {
|
||||
k=gr.scrn_zoom;
|
||||
k=gr.screen_zoom;
|
||||
while (k--) {
|
||||
src2=src;
|
||||
col=d2;
|
||||
while (col--) {
|
||||
src3=&map[*src2++];
|
||||
l=gr.scrn_zoom;
|
||||
l=gr.screen_zoom;
|
||||
while (l--) {
|
||||
*dst++=*src3;
|
||||
src3+=256;
|
||||
@ -367,13 +367,13 @@ U0 GrUpdateVGAGraphics()
|
||||
{//Update Graphic Card
|
||||
I64 row,plane,d=gr.zoomed_dc->width_internal>>6;
|
||||
U32 *src,*vga,*dst;
|
||||
if (gr.scrn_zoom==1)
|
||||
if (gr.screen_zoom==1)
|
||||
src=gr.dc1->body;
|
||||
else {
|
||||
GrZoomInScreen;
|
||||
src=gr.zoomed_dc->body;
|
||||
}
|
||||
dst=gr.scrn_image->body;
|
||||
dst=gr.screen_image->body;
|
||||
if (LBtr(&sys_semas[SEMA_FLUSH_VGA_IMAGE],0)) {
|
||||
for (plane=1;plane<0x10;plane<<=1) {
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
@ -409,8 +409,8 @@ U0 GrUpdateScreen()
|
||||
|
||||
dc=DCAlias(gr.dc2,Fs);
|
||||
dc->flags|=DCF_ON_TOP;
|
||||
if (gr.fp_final_scrn_update)
|
||||
(*gr.fp_final_scrn_update)(dc);
|
||||
if (gr.fp_final_screen_update)
|
||||
(*gr.fp_final_screen_update)(dc);
|
||||
DCDel(dc);
|
||||
|
||||
if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
|
||||
|
@ -1,8 +1,8 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
#define SPT_MENU -2
|
||||
#define SPT_INS_SCRN_BITMAP -3
|
||||
#define SPT_INS_TRANSPARENT_SCRN_BITMAP -4
|
||||
#define SPT_INS_SCREEN_BITMAP -3
|
||||
#define SPT_INS_TRANSPARENT_SCREEN_BITMAP -4
|
||||
#define SPT_ED_MENU -5
|
||||
#define SPT_EXIT -6
|
||||
|
||||
@ -43,9 +43,9 @@ I64 PopUpSpriteMain(CSprite **_head,I64 *_cur_elem_num,
|
||||
"$$MU-UL,\"BSpline3\",LE=SPT_BSPLINE3$$\n"
|
||||
"$$MU-UL,\"BSpline2 Closed\",LE=SPT_BSPLINE2_CLOSED$$\n"
|
||||
"$$MU-UL,\"BSpline3 Closed\",LE=SPT_BSPLINE3_CLOSED$$\n"
|
||||
"$$MU-UL,\"Insert Screen-Captured BitMap\",LE=SPT_INS_SCRN_BITMAP$$\n"
|
||||
"$$MU-UL,\"Insert Screen-Captured BitMap\",LE=SPT_INS_SCREEN_BITMAP$$\n"
|
||||
"$$MU-UL,\"Insert Transparent Screen-Captured BitMap\","
|
||||
"LE=SPT_INS_TRANSPARENT_SCRN_BITMAP$$\n"
|
||||
"LE=SPT_INS_TRANSPARENT_SCREEN_BITMAP$$\n"
|
||||
"$$PURPLE$$$$MU-UL,\"+] Create or Edit 3D Mesh\",LE=SPT_MESH$$\n"
|
||||
"$$MU-UL,\"+] Create or Edit Shiftable 3D Mesh\","
|
||||
"LE=SPT_SHIFTABLE_MESH$$\n"
|
||||
@ -266,14 +266,14 @@ CSprite *SMScreenBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,
|
||||
res->pwhu.x1=0;
|
||||
res->pwhu.y1=0;
|
||||
SpriteScreenInit(dc,x,y);
|
||||
i=gr.scrn_zoom;
|
||||
i=gr.screen_zoom;
|
||||
GrScaleZoom(1.0/i);
|
||||
Refresh(2,TRUE);
|
||||
|
||||
dc3=DCScreenCapture;
|
||||
img=DCExt(dc3,Fs->pix_left+Fs->scroll_x+xx1,Fs->pix_top+Fs->scroll_y+yy1,
|
||||
Fs->pix_left+Fs->scroll_x+xx2-1,Fs->pix_top+Fs->scroll_y+yy2-1);
|
||||
if (eletype==SPT_INS_TRANSPARENT_SCRN_BITMAP)
|
||||
if (eletype==SPT_INS_TRANSPARENT_SCREEN_BITMAP)
|
||||
DCColorChange(img,bm_bkcolor);
|
||||
GrScaleZoom(i);
|
||||
MemCopy(&res->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
@ -796,10 +796,10 @@ U0 SMTaskTitleSet(I64 eletype)
|
||||
{
|
||||
Fs->title_src=TTS_CONST; //Violates TTS_LOCKED_CONST
|
||||
switch (eletype) {
|
||||
case SPT_INS_SCRN_BITMAP:
|
||||
case SPT_INS_SCREEN_BITMAP:
|
||||
StrCopy(Fs->task_title,"Insert Screen BitMap");
|
||||
break;
|
||||
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
||||
StrCopy(Fs->task_title,"Insert Transparent Screen BitMap");
|
||||
break;
|
||||
default:
|
||||
@ -937,7 +937,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
PopUpOk("Select Origin.\n");
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
break;
|
||||
case SPT_INS_SCRN_BITMAP:
|
||||
case SPT_INS_SCREEN_BITMAP:
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n");
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
@ -969,7 +969,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
}
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
break;
|
||||
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
i=PopUpColor("Color to Become Transparent\n\n",,FALSE);
|
||||
if (i<0)
|
||||
@ -1095,8 +1095,8 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
case SPT_RECT:
|
||||
tmpg=SMRect(dc,x,y,arg1,arg2,color);
|
||||
break;
|
||||
case SPT_INS_SCRN_BITMAP:
|
||||
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||
case SPT_INS_SCREEN_BITMAP:
|
||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
||||
tmpg=SMScreenBitMap(eletype,dc,dc2,x,y,arg1,arg2,bm_bkcolor);
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
|
@ -40,7 +40,7 @@ public U0 InGetKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
|
||||
U8 buf[STR_LEN],*st;
|
||||
do {
|
||||
ch=GetKey(&sc);
|
||||
if (sc.u8[0]!=SC_PRTSCRN1 &&
|
||||
if (sc.u8[0]!=SC_PRINTSCREEN1 &&
|
||||
!(sc.u8[0]==SC_SHIFT && scan_code&SCF_SHIFT) &&
|
||||
!(sc.u8[0]==SC_CTRL && scan_code&SCF_CTRL) &&
|
||||
!(sc.u8[0]==SC_ALT && scan_code&SCF_ALT) ) {
|
||||
|
@ -17,8 +17,8 @@ I64 PenBrushesSize()
|
||||
I64 ScreenZoomTablesSize()
|
||||
{
|
||||
I64 res=0,i;
|
||||
for (i=1;i<=GR_SCRN_ZOOM_MAX;i++)
|
||||
res+=MSize2(gr.scrn_zoom_tables[i]);
|
||||
for (i=1;i<=GR_SCREEN_ZOOM_MAX;i++)
|
||||
res+=MSize2(gr.screen_zoom_tables[i]);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
||||
|
||||
if (task==sys_winmgr_task) {
|
||||
"gr.pen_brushes\t:%010X\n",PenBrushesSize;
|
||||
"gr.scrn_zoom_tbles\t:%010X\n",ScreenZoomTablesSize;
|
||||
"gr.screen_zoom_tbles\t:%010X\n",ScreenZoomTablesSize;
|
||||
"screencast.dc\t:%010X\n",DCSize(screencast.dc);
|
||||
"screencast.dc2_alias\t:%010X\n",DCSize(screencast.dc2_alias);
|
||||
} else if (task==zenith_task) {
|
||||
@ -183,7 +183,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
||||
"gr.dc1\t\t:%010X\n",DCSize(gr.dc1);
|
||||
"gr.dc2\t\t:%010X\n",DCSize(gr.dc2);
|
||||
"gr.dc_cache\t\t:%010X\n",DCSize(gr.dc_cache);
|
||||
"gr.scrn_image\t:%010X\n",DCSize(gr.scrn_image);
|
||||
"gr.screen_image\t:%010X\n",DCSize(gr.screen_image);
|
||||
"gr.zoomed_dc\t:%010X\n",DCSize(gr.zoomed_dc);
|
||||
}
|
||||
"$$ID,-2$$";
|
||||
|
@ -214,7 +214,7 @@ U0 WinFinalUpdate(CDC *dc)
|
||||
DrawMouse(dc);
|
||||
}
|
||||
|
||||
gr.fp_final_scrn_update=&WinFinalUpdate;
|
||||
gr.fp_final_screen_update=&WinFinalUpdate;
|
||||
|
||||
U0 WinMouseUpdate()
|
||||
{
|
||||
@ -237,15 +237,15 @@ U0 WinMouseUpdate()
|
||||
}
|
||||
} else
|
||||
mouse.speed*=0.95;
|
||||
if (gr.scrn_zoom!=1) {
|
||||
if (gr.screen_zoom!=1) {
|
||||
if (gr.continuous_scroll)
|
||||
GrScaleZoom(1.0);
|
||||
else {
|
||||
dd=(mouse.pos.x-gr.sx)*gr.scrn_zoom;
|
||||
dd=(mouse.pos.x-gr.sx)*gr.screen_zoom;
|
||||
if (!(8<=dd<GR_WIDTH-8))
|
||||
GrScaleZoom(1.0);
|
||||
else {
|
||||
dd=(mouse.pos.y-gr.sy)*gr.scrn_zoom;
|
||||
dd=(mouse.pos.y-gr.sy)*gr.screen_zoom;
|
||||
if (!(8<=dd<GR_HEIGHT-8))
|
||||
GrScaleZoom(1.0);
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ U0 FMRightClick()
|
||||
}
|
||||
|
||||
U8 *fm_mouse_str=NULL;
|
||||
U0 (*fp_old_final_scrn_update)(CDC *dc);
|
||||
U0 (*fp_old_final_screen_update)(CDC *dc);
|
||||
|
||||
U0 FMFinalScreenUpdate(CDC *dc)
|
||||
{
|
||||
@ -573,7 +573,7 @@ U0 FMFinalScreenUpdate(CDC *dc)
|
||||
dc->color=LTRED;
|
||||
GrPrint(dc,mouse.pos.x,mouse.pos.y,"%s",fm_mouse_str);
|
||||
}
|
||||
(*fp_old_final_scrn_update)(dc);
|
||||
(*fp_old_final_screen_update)(dc);
|
||||
}
|
||||
|
||||
public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
@ -586,7 +586,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
Bool okay;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
fp_old_final_scrn_update=gr.fp_final_scrn_update;
|
||||
fp_old_final_screen_update=gr.fp_final_screen_update;
|
||||
MenuFilePush("::/Doc/FileMgrPullDown.DD");
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
if (tmpde1=Cd2DirEntry(head,old_cur_dir))
|
||||
@ -611,11 +611,11 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
case MESSAGE_MS_L_DOWN:
|
||||
doc_ce=doc->cur_entry;
|
||||
fm_mouse_str=doc_ce->tag;
|
||||
gr.fp_final_scrn_update=&FMFinalScreenUpdate;
|
||||
gr.fp_final_screen_update=&FMFinalScreenUpdate;
|
||||
break;
|
||||
case MESSAGE_MS_L_UP:
|
||||
if (doc_ce) {
|
||||
gr.fp_final_scrn_update=fp_old_final_scrn_update;
|
||||
gr.fp_final_screen_update=fp_old_final_screen_update;
|
||||
if (WinCursorPosSet(Fs,arg1+Fs->pix_left+Fs->scroll_x,
|
||||
arg2+Fs->pix_top+Fs->scroll_y,TRUE)) {
|
||||
doc_e=doc->cur_entry;
|
||||
@ -776,7 +776,7 @@ fm_regular_key:
|
||||
break;
|
||||
}
|
||||
} while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
|
||||
gr.fp_final_scrn_update=fp_old_final_scrn_update;
|
||||
gr.fp_final_screen_update=fp_old_final_screen_update;
|
||||
Fs->put_doc =old_put_doc;
|
||||
Fs->display_doc=old_display_doc;
|
||||
SettingsPop;
|
||||
|
Loading…
x
Reference in New Issue
Block a user