Browse Source

TempleOSCDV5.01.ISO

v6
Terry A. Davis 5 years ago
committed by minexew
parent
commit
320c7ee98a
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. 6
      Adam/ABlkDev/ADskA.HC
  3. 2
      Adam/ABlkDev/ChkDsk.HC
  4. 84
      Adam/ABlkDev/FileMgr.HC
  5. 2
      Adam/ABlkDev/Mount.HC
  6. 2
      Adam/ADbg.HC
  7. 6
      Adam/ADefine.HC
  8. 10
      Adam/AExts.HC
  9. 8
      Adam/AHash.HC
  10. 6
      Adam/AMathODE.HC
  11. 49
      Adam/ARegistry.HC
  12. 8
      Adam/AutoComplete/ACTask.HC
  13. 6
      Adam/DevInfo.HC
  14. 2
      Adam/DolDoc/DocBin.HC
  15. 16
      Adam/DolDoc/DocChar.HC
  16. 2
      Adam/DolDoc/DocCodeTools.HC
  17. 8
      Adam/DolDoc/DocEd.HC
  18. 4
      Adam/DolDoc/DocFind.HC
  19. 8
      Adam/DolDoc/DocForm.HC
  20. 10
      Adam/DolDoc/DocGet.HC
  21. 6
      Adam/DolDoc/DocGr.HC
  22. 27
      Adam/DolDoc/DocHighlight.HC
  23. 4
      Adam/DolDoc/DocInit.HC
  24. 2
      Adam/DolDoc/DocMacro.HC
  25. 4
      Adam/DolDoc/DocNew.HC
  26. 14
      Adam/DolDoc/DocPlain.HC
  27. 6
      Adam/DolDoc/DocPopUp.HC
  28. 14
      Adam/DolDoc/DocRecalc.HC
  29. 2
      Adam/DolDoc/DocRecalcLib.HC
  30. 2
      Adam/DolDoc/DocTree.HC
  31. 12
      Adam/DolDoc/MakeDoc.HC
  32. 2
      Adam/God/GodExt.HC
  33. 2
      Adam/Gr/Gr.HH
  34. 14
      Adam/Gr/GrComposites.HC
  35. 30
      Adam/Gr/GrDC.HC
  36. 20
      Adam/Gr/GrGlbls.HC
  37. 4
      Adam/Gr/GrInitB.HC
  38. 10
      Adam/Gr/GrPalette.HC
  39. 20
      Adam/Gr/GrPrimatives.HC
  40. 2
      Adam/Gr/GrScrn.HC
  41. 14
      Adam/Gr/GrSpritePlot.HC
  42. 4
      Adam/Gr/SpriteEd.HC
  43. 8
      Adam/Gr/SpriteMesh.HC
  44. 6
      Adam/Gr/SpriteNew.HC
  45. 2
      Adam/Host.HC
  46. 6
      Adam/InFile.HC
  47. 4
      Adam/InsReg.HC
  48. 2
      Adam/Opt/Boot/BootDVDIns.HC
  49. 2
      Adam/Opt/Boot/BootHDIns.HC
  50. 2
      Adam/Opt/Boot/BootMHDIns.HC
  51. 2
      Adam/Opt/Boot/BootRAM.HC
  52. 78
      Adam/Opt/Boot/DskISORedSea.HC
  53. 34
      Adam/Opt/Utils/FileBMP.HC
  54. 19
      Adam/Opt/Utils/LinkChk.HC
  55. 8
      Adam/Opt/Utils/MemRep.HC
  56. 79
      Adam/Opt/Utils/TOS.HC
  57. 12
      Adam/Snd/SndFile.HC
  58. 8
      Adam/Snd/SndMath.HC
  59. BIN
      Adam/WallPaper.HC
  60. 15
      Adam/Win.HC
  61. 2
      Adam/WinMgr.HC
  62. 2
      Apps/Budget/BgtEntry.HC
  63. 2
      Apps/Budget/Budget.HC
  64. 8
      Apps/GrModels/BallGen.HC
  65. 8
      Apps/GrModels/ManGen.HC
  66. 66
      Apps/KeepAway/KeepAway.HC
  67. 18
      Apps/Logic/Logic.HC
  68. 2
      Apps/Psalmody/JukePuppet.HC
  69. 24
      Apps/Psalmody/PsalmodyDraw.HC
  70. 2
      Apps/Psalmody/PsalmodyFile.HC
  71. 16
      Apps/Psalmody/PsalmodyMain.HC
  72. 4
      Apps/Span/Span.HH
  73. 4
      Apps/Span/SpanMain.HC
  74. 26
      Apps/Strut/Strut.HC
  75. 76
      Apps/Titanium/Titanium.HC
  76. 2
      Apps/ToTheFront/AIs/Human.HC
  77. 12
      Apps/ToTheFront/AIs/SimpleAI.HC
  78. BIN
      Apps/ToTheFront/TTFDraw.HC
  79. 8
      Apps/ToTheFront/TTFGlbls.HC
  80. 14
      Apps/ToTheFront/TTFInit.HC
  81. 2
      Apps/ToTheFront/TTFLib.HC
  82. 40
      Apps/ToTheFront/TTFVis.HC
  83. 2
      Apps/ToTheFront/ToTheFront.HC
  84. 70
      Apps/X-Caliber/X-Caliber.HC
  85. 6
      Apps/X-Caliber/XCCtrls.HC
  86. 28
      Compiler/Asm.HC
  87. 2
      Compiler/AsmInit.HC
  88. 4
      Compiler/AsmResolve.HC
  89. 22
      Compiler/BackA.HC
  90. 22
      Compiler/BackB.HC
  91. 36
      Compiler/BackC.HC
  92. 4
      Compiler/BackFA.HC
  93. 2
      Compiler/BackFB.HC
  94. 30
      Compiler/BackLib.HC
  95. 30
      Compiler/CInit.HC
  96. 14
      Compiler/CMain.HC
  97. BIN
      Compiler/Compiler.BIN
  98. 163
      Compiler/Compiler.MAP
  99. 4
      Compiler/CompilerA.HH
  100. 1
      Compiler/CompilerB.HH

BIN
0000Boot/0000Kernel.BIN.C

Binary file not shown.

6
Adam/ABlkDev/ADskA.HC

@ -204,7 +204,7 @@ public I64 DelTree(U8 *files_find_mask,U8 *fu_flags=NULL)
return res;
}
U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=I64_MIN)
{
CDrv *dv=Let2Drv(*filename);
CDirEntry de;
@ -219,7 +219,7 @@ U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
if (!*cur_dir)
StrCpy(cur_dir,"/");
ScanFlags(&de.attr,Define("ST_FILE_ATTRS"),attr);
if (cdt==MIN_I64)
if (cdt==I64_MIN)
de.datetime=Now;
else
de.datetime=cdt;
@ -230,7 +230,7 @@ U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
Free(cur_dir);
}
public U0 Touch(U8 *files_find_mask="*",U8 *attr="+?",
U8 *fu_flags=NULL,CDate cdt=MIN_I64)
U8 *fu_flags=NULL,CDate cdt=I64_MIN)
{/*Touch file attributes and DateTime.
Default lists attributes.
attr: "+?" =show current

2
Adam/ABlkDev/ChkDsk.HC

@ -353,7 +353,7 @@ public U0 DskView(U8 drv_let=0)
GrCircle(dc,h>>1,v>>1,radius);
j=1;
for (i=0;i<NUM_DRVS;i++) {
for (i=0;i<DRVS_NUM;i++) {
dv=&blkdev.drvs[i];
if (bd==dv->bd && dv->fs_type) {
sect_start=-(dv->drv_offset*2*ã/(bd->max_blk+1));

84
Adam/ABlkDev/FileMgr.HC

@ -207,15 +207,15 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
break;
case FM_PICK_FILE:
DocPrint(doc,"$$PURPLE$$Pick file and press <ESC>\n\n");
doc->flags|=DOCF_MIN_SIZE;
doc->flags|=DOCF_SIZE_MIN;
break;
case FM_PICK_DIR:
DocPrint(doc,"$$PURPLE$$Pick directory and press <ESC>\n\n");
doc->flags|=DOCF_MIN_SIZE;
doc->flags|=DOCF_SIZE_MIN;
break;
}
DocPrint(doc,"$$LTBLUE$$");
for (i=0;i<NUM_DRVS;i++) {
for (i=0;i<DRVS_NUM;i++) {
dv=&blkdev.drvs[i];
if (dv->bd->type==BDT_ATAPI) {
if (dv->bd->flags&BDF_INITIALIZED)
@ -388,7 +388,7 @@ U0 FMFmtDrv(CDoc *doc)
Free(st);
}
U0 FMMakeISO(CDoc *doc)
U0 FMMakeISO(CDoc *doc,I64 type)
{
CDocEntry *doc_ce=doc->cur_entry;
CDirEntry *tmpde;
@ -402,12 +402,19 @@ U0 FMMakeISO(CDoc *doc)
tmpde=tmpde->parent;
if (tmpde && *tmpde->full_name) {
Silent;
if (tmpde->full_name[StrLen(tmpde->full_name)-1]=='/')
st=MStrPrint("%s*",tmpde->full_name);
else
st=MStrPrint("%s/*",tmpde->full_name);
ISO9660ISO(,st);
Free(st);
switch (type) {
case FSt_REDSEA:
RedSeaISO(,tmpde->full_name);
break;
case FSt_ISO9660:
if (tmpde->full_name[StrLen(tmpde->full_name)-1]=='/')
st=MStrPrint("%s*",tmpde->full_name);
else
st=MStrPrint("%s/*",tmpde->full_name);
ISO9660ISO(,st);
Free(st);
break;
}
Silent(OFF);
}
}
@ -486,32 +493,35 @@ U0 FMCopy(CDoc *doc)
#define FMR_PASTE 6
#define FMR_CHG_DSK 7
#define FMR_FORMAT 8
#define FMR_MOUNT_ISO 9
#define FMR_MOUNT_REDSEA_ISO_C 9
#define FMR_UNMOUNT 10
#define FMR_MAKE_ISO 11
#define FMR_BURN_ISO 12
#define FMR_HELP 13
#define FMR_MAKE_REDSEA_ISO_C 11
#define FMR_MAKE_ISO9660 12
#define FMR_BURN_ISO 13
#define FMR_HELP 14
I64 PopUpFMRight(U8 *header=NULL,U8 *footer=NULL)
{
I64 i;
CDoc *doc=DocNew;
if (header) DocPrint(doc,"%s",header);
DocPrint(doc,"$$CM+LX,1,1 $$$$BT,\"INCLUDE \",LE=FMR_INCLUDE$$"
"$$CM+LX,27,0$$$$BT,\"ADAM INCLUDE \",LE=FMR_ADAM_INCLUDE$$"
"$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=FMR_DELETE$$"
"$$CM+LX,27,0$$$$BT,\"RENAME \",LE=FMR_RENAME$$"
"$$CM+LX,1,3 $$$$BT,\"MAKE DIRECTORY \",LE=FMR_MKDIR$$"
"$$CM+LX,27,0$$$$BT,\"PLAIN-TEXT EDIT \",LE=FMR_PLAIN$$"
"$$CM+LX,1,3 $$$$BT,\"PASTE CLIPBOARD FILES \",LE=FMR_PASTE$$"
"$$CM+LX,27,0$$$$BT,\"CHANGE DISK(MOUNT IT) \",LE=FMR_CHG_DSK$$"
"$$CM+LX,1,3 $$$$BT,\"FORMAT \",LE=FMR_FORMAT$$"
"$$CM+LX,1,3 $$$$BT,\"MOUNT ISO.C FILE \",LE=FMR_MOUNT_ISO$$"
"$$CM+LX,27,0$$$$BT,\"UNMOUNT \",LE=FMR_UNMOUNT$$"
"$$CM+LX,1,3 $$$$BT,\"MAKE ISO (CD/DVD) FILE\",LE=FMR_MAKE_ISO$$"
"$$CM+LX,27,0$$$$BT,\"BURN ISO (CD/DVD) FILE\",LE=FMR_BURN_ISO$$"
"$$CM+LX,1,3 $$$$BT,\"HELP \",LE=FMR_HELP$$"
"$$CM+LX,27,0$$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$\n");
DocPrint(doc,"$$CM+LX,1,1 $$$$BT,\"INCLUDE \",LE=FMR_INCLUDE$$"
"$$CM+LX,29,0$$$$BT,\"ADAM INCLUDE \",LE=FMR_ADAM_INCLUDE$$"
"$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=FMR_DELETE$$"
"$$CM+LX,29,0$$$$BT,\"RENAME \",LE=FMR_RENAME$$"
"$$CM+LX,1,3 $$$$BT,\"MAKE DIRECTORY \",LE=FMR_MKDIR$$"
"$$CM+LX,29,0$$$$BT,\"PLAIN-TEXT EDIT \",LE=FMR_PLAIN$$"
"$$CM+LX,1,3 $$$$BT,\"PASTE CLIPBOARD FILES \",LE=FMR_PASTE$$"
"$$CM+LX,29,0$$$$BT,\"CHANGE DISK(MOUNT IT) \",LE=FMR_CHG_DSK$$"
"$$CM+LX,1,3 $$$$BT,\"FORMAT \",LE=FMR_FORMAT$$"
"$$CM+LX,1,3 $$$$BT,\"MOUNT ISO.C FILE \","
"LE=FMR_MOUNT_REDSEA_ISO_C$$"
"$$CM+LX,29,0$$$$BT,\"UNMOUNT \",LE=FMR_UNMOUNT$$"
"$$CM+LX,1,3 $$$$BT,\"MAKE ISO.C (CD/DVD) FILE\",LE=FMR_MAKE_REDSEA_ISO_C$$"
"$$CM+LX,29,0$$$$BT,\"MAKE ISO (CD/DVD) FILE \",LE=FMR_MAKE_ISO9660$$"
"$$CM+LX,1,3 $$$$BT,\"BURN ISO (CD/DVD) FILE \",LE=FMR_BURN_ISO$$"
"$$CM+LX,1,3 $$$$BT,\"HELP \",LE=FMR_HELP$$"
"$$CM+LX,29,0$$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$\n");
if (footer) DocPrint(doc,"%s",footer);
i=PopUpMenu(doc);
DocDel(doc);
@ -543,18 +553,21 @@ U0 FMRightClick()
Msg(MSG_KEY_DOWN,0,SC_INS+SCF_SHIFT);
break;
case FMR_CHG_DSK:
Msg(MSG_KEY_DOWN,'m',0);
Msg(MSG_KEY_DOWN,'c',0);
break;
case FMR_FORMAT:
Msg(MSG_KEY_DOWN,'f',0);
break;
case FMR_MOUNT_ISO:
case FMR_MOUNT_REDSEA_ISO_C:
Msg(MSG_KEY_DOWN,'i',0);
break;
case FMR_UNMOUNT:
Msg(MSG_KEY_DOWN,'u',0);
break;
case FMR_MAKE_ISO:
case FMR_MAKE_REDSEA_ISO_C:
Msg(MSG_KEY_DOWN,'m',0);
break;
case FMR_MAKE_ISO9660:
Msg(MSG_KEY_DOWN,'M',0);
break;
case FMR_BURN_ISO:
@ -702,7 +715,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
case CH_CTRLY:
FMDelete(doc);
break;
case 'm':
case 'c':
FMChgDsk(doc);
break;
case 'i':
@ -712,7 +725,10 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
FMUnmount(doc);
break;
case 'M':
FMMakeISO(doc);
FMMakeISO(doc,FSt_ISO9660);
break;
case 'm':
FMMakeISO(doc,FSt_REDSEA);
break;
case 'B':
FMBurnISO(doc);

2
Adam/ABlkDev/Mount.HC

@ -33,7 +33,7 @@ U8 Mount2(U8 boot_drv_let,CDoc *_doc,Bool _caller_is_prtdsk)
make_free=TRUE;
}
unit=0;
prt_num=MIN_I64;
prt_num=I64_MIN;
switch (type) {
case BDT_RAM:
"Addr of RAM disk ($$PURPLE$$<ENTER>$$FG$$ to MAlloc):";

2
Adam/ADbg.HC

@ -239,7 +239,7 @@ public U0 FunRep(U8 *st,U8 *rbp=NULL,I64 max_depth=2,CTask *task=NULL)
} else {
tmpm=tmpf->member_lst_and_root;
while (tmpm) {
if (0<=tmpm->reg<NUM_REGS)
if (0<=tmpm->reg<REG_REGS_NUM)
"%08Z %s\n",tmpm->reg,"ST_U64_REGS",tmpm->str;
else
"%08tX %s\n",tmpm->offset,tmpm->str;

6
Adam/ADefine.HC

@ -9,10 +9,10 @@ U0 LoadDocDefines()
(Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS);
//This is cut and replaced when I generate a distro.
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.HC,DD_TEMPLEOS_LOC"$.
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOS/TOSDistro.HC,DD_TEMPLEOS_LOC"$.
$TR-C,"LineRep"$
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,466");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,791");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,710");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,944");
$ID,-4$
DefinePrint("DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;

10
Adam/AExts.HC

@ -33,7 +33,7 @@ extern Bool DocHighlightCursor(Bool show=OFF,CDoc *doc=NULL);
extern U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2);
extern U0 DocInsEntry(CDoc *doc,CDocEntry *doc_e);
extern Bool DocLock(CDoc *doc);
extern I64 DocMax(I64 i=MAX_I64);
extern I64 DocMax(I64 i=I64_MAX);
extern CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL);
extern CDocEntry *DocPrint(CDoc *doc=NULL,U8 *fmt,...);
extern CDoc *DocPut(CTask *task=NULL);
@ -50,7 +50,7 @@ extern U0 EdCodeTools(CDoc *doc);
extern U8 *EdSprite(I64 bin_num);
extern I64 ExeDoc(CDoc *doc,I64 ccf_flags=0);
extern I64 FindWiz();
extern I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=MIN_I64,I64 hi=MAX_I64);
extern I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=I64_MIN,I64 hi=I64_MAX);
extern Bool GrPlot0(CDC *dc,I64 x,I64 y);
extern I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
U8 *fu_flags=NULL,U8 *_stage2_filename=NULL);
@ -69,8 +69,8 @@ extern I64 PopUpColorLighting(U8 *header=NULL);
extern I64 PopUpFile(U8 *filename,
Bool warn_ext=TRUE,CTask *parent=NULL,CTask **_pu_task=NULL);
extern Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,
I64 dof_flags=DOF_MIN_SIZE,U8 *header=NULL,U8 *footer=NULL);
extern I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64);
I64 dof_flags=DOF_SIZE_MIN,U8 *header=NULL,U8 *footer=NULL);
extern I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=I64_MIN,I64 hi=I64_MAX);
extern U8 *PopUpGetStr(U8 *header=NULL);
extern I64 PopUpMenu(CDoc *doc,I64 dof_flags=0);
extern Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL);
@ -78,6 +78,8 @@ extern Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL);
extern I64 PopUpRangeI64(
I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL);
extern Bool PopUpTransform(I64 *r);
extern I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
U8 *_stage2_filename=NULL);
extern U0 Refresh(I64 cnt=1,Bool force=FALSE);
extern U0 RegOneTimePopUp(I64 flag_num,U8 *msg);
extern Bool RegWrite(U8 *path,U8 *fmt,...);

8
Adam/AHash.HC

@ -326,11 +326,11 @@ wh_done:
#help_index "Info;Hash;Cmd Line (Typically)"
#define HDR_MAX 16
#define HDR_NUM 16
public I64 HashDepthRep(CHashTable *table=NULL)
{//Hash table linked-list chain depth report.
//Histogram of collision count.
I64 i,j,longest=0,cnt=0,a[HDR_MAX];
I64 i,j,longest=0,cnt=0,a[HDR_NUM];
CHash *tmph;
if (!table) table=Fs->hash_table;
MemSet(a,0,sizeof(a));
@ -338,7 +338,7 @@ public I64 HashDepthRep(CHashTable *table=NULL)
tmph=table->body[i];
if (tmph) {
j=LinkedLstCnt(tmph);
if (j<HDR_MAX)
if (j<HDR_NUM)
a[j]++;
cnt+=j;
if (j>longest)
@ -346,7 +346,7 @@ public I64 HashDepthRep(CHashTable *table=NULL)
}
}
"Histogram\n";
for (i=0;i<HDR_MAX;i++)
for (i=0;i<HDR_NUM;i++)
if (a[i])
"%02d:%d\n",i,a[i];
"Size:%d Count:%d Longest:%d\n",

6
Adam/AMathODE.HC

@ -156,7 +156,7 @@ public U0 ODERenum(CMathODE *ode)
public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
{//Search for mass nearest to x,y,z.
CMass *tmpm,*best_mass=NULL;
F64 dd,best_dd=MAX_F64;
F64 dd,best_dd=F64_MAX;
tmpm=ode->next_mass;
while (tmpm!=&ode->next_mass) {
@ -173,7 +173,7 @@ public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
{//Find spring midpoint nearest x,y,z.
CSpring *tmps,*best_spring=NULL;
F64 dd,best_dd=MAX_F64;
F64 dd,best_dd=F64_MAX;
tmps=ode->next_spring;
while (tmps!=&ode->next_spring) {
@ -195,7 +195,7 @@ public U0 MassOrSpringFind(
{//Find spring or mass nearest x,y,z.
CMass *tmpm,*best_mass=NULL;
CSpring *tmps,*best_spring=NULL;
F64 dd,best_dd=MAX_F64;
F64 dd,best_dd=F64_MAX;
tmpm=ode->next_mass;
while (tmpm!=&ode->next_mass) {

49
Adam/ARegistry.HC

@ -1,4 +1,4 @@
#help_index "Misc/Registry"
#help_index "Registry"
#define REGISTRY_FILENAME "~/Registry.HC.Z"
CDoc *sys_registry_doc=NULL;
I64 sys_msg_flags[1]={0};
@ -145,7 +145,8 @@ U0 RegInit()
}
}
#help_index "Boot/Once;Misc/Once"
#help_index "Boot/Once;Registry/Once"
#help_file "::/Doc/Once"
public U0 AOnceFlush()
{//Flush AOnce() buf.
@ -158,51 +159,71 @@ public U0 OnceFlush()
}
public U0 AOnce(U8 *fmt,...)
{//Writes Adam code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
{//Add Adam code to $LK,"~/Registry.HC"$, executed next boot.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
if (!Bt(&sys_run_level,RLf_ONCE_ADAM))
AOnceFlush;
RegAppend("Once/Adam","%s\n",buf);
Free(buf);
}
public U0 Once(U8 *fmt,...)
{//Writes User code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
{//Add User code to $LK,"~/Registry.HC"$, executed next boot.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
if (!Bt(&sys_run_level,RLf_ONCE_USER))
OnceFlush;
RegAppend("Once/User","%s\n",buf);
Free(buf);
}
public U0 AOnceDrv(U8 drv_let=0,U8 *fmt,...)
{//Writes Adam code to drv $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
{//Add Adam code to drv $LK,"~/Registry.HC"$, executed next boot.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
I64 old_drv_let=*sys_registry_doc->filename.name;
if (drv_let)
*sys_registry_doc->filename.name=drv_let;
if (!Bt(&sys_run_level,RLf_ONCE_ADAM))
AOnceFlush;
RegAppend("Once/Adam","%s\n",buf);
Free(buf);
*sys_registry_doc->filename.name=old_drv_let;
}
public U0 OnceDrv(U8 drv_let=0,U8 *fmt,...)
{//Writes User code to drv $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
{//Add User code to drv $LK,"~/Registry.HC"$, executed next boot.
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
I64 old_drv_let=*sys_registry_doc->filename.name;
if (drv_let)
*sys_registry_doc->filename.name=drv_let;
if (!Bt(&sys_run_level,RLf_ONCE_USER))
OnceFlush;
RegAppend("Once/User","%s\n",buf);
Free(buf);
*sys_registry_doc->filename.name=old_drv_let;
}
public U0 OnceExe()
{//Execute Once code. This goes in $LK,"~/Once.HC"$.
RegDft("Once/Adam","");
if (RegCnt("Once/Adam")>2) {
Adam("RegExe(\"Once/Adam\");");
{//Execute Once code. Call goes in $LK,"~/Once.HC"$.
try {
RegDft("Once/Adam","");
if (RegCnt("Once/Adam")>2) {
Adam("RegExe(\"Once/Adam\");");
AOnceFlush;
}
LBts(&sys_run_level,RLf_ONCE_ADAM);
RegDft("Once/User","");
if (RegCnt("Once/User")>2) {
RegExe("Once/User");
OnceFlush;
}
LBts(&sys_run_level,RLf_ONCE_USER);
} catch {
AOnceFlush;
}
RegDft("Once/User","");
if (RegCnt("Once/User")>2) {
RegExe("Once/User");
LBts(&sys_run_level,RLf_ONCE_ADAM);
OnceFlush;
LBts(&sys_run_level,RLf_ONCE_USER);
}
}

8
Adam/AutoComplete/ACTask.HC

@ -4,7 +4,7 @@ U0 ACDDictWordsAdd(U8 *st)
I64 i;
U8 *ptr;
if (st && *st && (ptr=ACDWordPtAt(st))) {
for (i=0;i<ACD_MAX_FILLINS;i++) {
for (i=0;i<ACD_FILLINS_NUM;i++) {
if (*ptr++!=ACD_WORD_CHAR)
break;
if (i) '\n';
@ -21,7 +21,7 @@ U0 ACDocRst(I64 left,I64 top)
{
CDoc *doc=DocPut;
DocRst(doc,TRUE);
doc->flags|=DOCF_MIN_SIZE;
doc->flags|=DOCF_SIZE_MIN;
Fs->border_src=BDS_CONST;
Fs->border_attr=LTGRAY<<4+DrvTextAttrGet(':')&15;
Fs->text_attr =LTGRAY<<4+BLUE;
@ -63,7 +63,7 @@ I64 ACPriorWordInStr(U8 *src,U8 *dst,I64 len,I64 buf_size)
U0 ACFillInAdd(CHashAC *tmpw)
{
I64 k;
if (ac.num_fillins<AC_MAX_FILLINS ||
if (ac.num_fillins<AC_FILLINS_NUM ||
tmpw->hits>ac.fillin_hits[ac.num_fillins-1]) {
for (k=ac.num_fillins-1;k>=0;k--) {
if (tmpw->hits<=ac.fillin_hits[k])
@ -75,7 +75,7 @@ U0 ACFillInAdd(CHashAC *tmpw)
}
ac.fillin_matches[k+1]=tmpw;
ac.fillin_hits[k+1] =tmpw->hits;
if (ac.num_fillins<AC_MAX_FILLINS)
if (ac.num_fillins<AC_FILLINS_NUM)
ac.num_fillins++;
}
}

6
Adam/DevInfo.HC

@ -210,11 +210,11 @@ public U0 MemPageRep()
else
"$$RED$$2MEG$$FG$$ pages\n";
"PML2\t :%010X 2MEG :%08X\n",
*MEM_PML2(U64 *),*MEM_NUM_2MEG(U64 *);
*MEM_PML2(U64 *),*MEM_2MEG_NUM(U64 *);
"PML3\t :%010X 1GIG :%08X\n",
*MEM_PML3(U64 *),*MEM_NUM_1GIG(U64 *);
*MEM_PML3(U64 *),*MEM_1GIG_NUM(U64 *);
"PML4\t :%010X 512GIG:%08X\n",
*MEM_PML4(U64 *),*MEM_NUM_512GIG(U64 *);
*MEM_PML4(U64 *),*MEM_512GIG_NUM(U64 *);
"FIXED_AREA:%010X\n",SYS_FIXED_AREA;
"HEAP_BASE :%010X\nHEAP_LIMIT:%010X\n",mem_heap_base,mem_heap_limit;
}

2
Adam/DolDoc/DocBin.HC

@ -46,7 +46,7 @@ U0 DocBinsValidate(CDoc *doc)
if (doc_e->de_flags & DOCEF_HAS_BIN) {
if (b=doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num)) {
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
b->tmp_use_cnt=MAX_I32;
b->tmp_use_cnt=I32_MAX;
if (!b->use_cnt++)
b->renum_num=++renum_num;
doc_e->bin_num=b->renum_num;

16
Adam/DolDoc/DocChar.HC

@ -18,14 +18,14 @@ public I64 EdCurU8(CDoc *doc)
return res;
}
public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
public U0 EdCursorLeft(CDoc *doc,I64 sc=I64_MIN)
{//Move cursor left. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$().
//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example.
U8 *dst;
Bool unlock=DocLock(doc);
CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
I64 cc=doc->cur_col,y=doc_ce->y;
if (sc!=MIN_I64) sc=sc.u32[0];
if (sc!=I64_MIN) sc=sc.u32[0];
if (sc>=0 && sc&SCF_CTRL) {
while (doc_ce->last!=doc && (doc_ce->last->y==y ||
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)))
@ -90,14 +90,14 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
DocUnlock(doc);
}
public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
public U0 EdCursorRight(CDoc *doc,I64 sc=I64_MIN)
{//Move cursor right. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$().
//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example.
Bool unlock=DocLock(doc);
U8 *dst;
CDocEntry *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
I64 cc=doc->cur_col,y=doc_ce->y,old_de_flags,old_color;
if (sc!=MIN_I64) sc=sc.u32[0];
if (sc!=I64_MIN) sc=sc.u32[0];
if (sc>=0 && sc&SCF_CTRL) {
while (doc_ce!=doc && doc_ce->next->y==y &&
doc_ce->next->type_u8!=DOCT_SOFT_NEW_LINE && doc_ce->next!=doc &&
@ -166,7 +166,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
DocUnlock(doc);
}
public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
public U0 EdLineUp(CDoc *doc,I64 sc=I64_MIN)
{//Move cursor up. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$().
//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example.
Bool unlock=DocLock(doc);
@ -174,7 +174,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
I64 y,x;
CDocEntry *doc_ce=doc->cur_entry,*doc_ne;
if (sc!=MIN_I64) sc=sc.u32[0];
if (sc!=I64_MIN) sc=sc.u32[0];
if (doc_ce->type_u8==DOCT_HEX_ED) {
doc->cur_col=doc->cur_col-doc_ce->hex_ed_width*3;
if (doc->cur_col>=0) {
@ -277,14 +277,14 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
DocUnlock(doc);
}
public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
public U0 EdLineDown(CDoc *doc,I64 sc=I64_MIN)
{//Move cursor down. Might need a call to $LK,"DocRecalc",A="MN:DocRecalc"$().
//See $LK,"EdRenumAsm",A="MN:EdRenumAsm"$ for an example.
Bool unlock=DocLock(doc);
U8 *dst;
I64 y,x,old_de_flags=0,old_color;
CDocEntry *doc_ce=doc->cur_entry,*doc_ne,*doc_ce2;
if (sc!=MIN_I64) sc=sc.u32[0];
if (sc!=I64_MIN) sc=sc.u32[0];
if (doc_ce->type_u8==DOCT_HEX_ED) {
doc->cur_col=doc->cur_col+doc_ce->hex_ed_width*3;
if (doc->cur_col>=doc_ce->len*3) {

2
Adam/DolDoc/DocCodeTools.HC

@ -601,7 +601,7 @@ U0 EdPopUpChSC(I64 *_ch,I64 *_sc)
{
I64 sc;
"Press A Key\n";
DocPut->flags|=DOCF_MIN_SIZE;
DocPut->flags|=DOCF_SIZE_MIN;
do GetMsg(_ch,&sc,1<<MSG_KEY_DOWN);
while (sc.u8[0]==SC_SHIFT || sc.u8[0]==SC_CTRL || sc.u8[0]==SC_ALT);
*_sc=sc;

8
Adam/DolDoc/DocEd.HC

@ -146,13 +146,13 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
LBts(&Fs->display_flags,DISPLAYf_SHOW);
WinZBufUpdate;
}
if (dof_flags&DOF_MIN_SIZE)
doc->flags|=DOCF_MIN_SIZE;
if (dof_flags&DOF_SIZE_MIN)
doc->flags|=DOCF_SIZE_MIN;
DocUnlock(doc);
if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) {
Refresh(2,TRUE);
if (doc->flags&DOCF_MIN_SIZE)
if (doc->flags&DOCF_SIZE_MIN)
Refresh(2,TRUE);
}
res=View;
@ -178,7 +178,7 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
}
Free(old_task_title);
DocDel(bdoc);
if (dof_flags&DOF_MIN_SIZE) {
if (dof_flags&DOF_SIZE_MIN) {
WinHorz(old_left,old_right);
WinVert(old_top,old_bottom);
}

4
Adam/DolDoc/DocFind.HC

@ -17,7 +17,7 @@ public Bool DocLineNumGoTo(CDoc *doc,I64 line_num) //one based
return res;
}
public Bool DocFind(CDoc *haystack_doc,I64 start_line_num=MIN_I64,
public Bool DocFind(CDoc *haystack_doc,I64 start_line_num=I64_MIN,
U8 *needle,I64 match=1)
{//Find str by searching tags. Move cur_entry & center.
Bool res=FALSE,unlock;
@ -26,7 +26,7 @@ U8 *needle,I64 match=1)
I64 i;
if (haystack_doc) {
unlock=DocLock(haystack_doc);
if (start_line_num==MIN_I64) {
if (start_line_num==I64_MIN) {
res=TRUE;
doc_e=haystack_doc->head.next;
} else {

8
Adam/DolDoc/DocForm.HC

@ -223,8 +223,8 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
doc->desc='Form';
if (header) DocPrint(doc,"%s",header);
doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM;
if (dof_flags&DOF_MIN_SIZE)
doc->flags|=DOCF_MIN_SIZE;
if (dof_flags&DOF_SIZE_MIN)
doc->flags|=DOCF_SIZE_MIN;
ml=tmpc->member_lst_and_root;
while (ml) {
if ((fmtstr=MemberMetaData("fmtstr",ml)) &&
@ -332,12 +332,12 @@ dm_restart:
public I64 PopUpMenu(CDoc *doc,I64 dof_flags=0)
{//Run menu chooser doc in PopUp win task.
doc->flags|=DOCF_MIN_SIZE | DOCF_FORM;
doc->flags|=DOCF_SIZE_MIN | DOCF_FORM;
return PopUpPrint("DocMenu(0x%X,0x%X);",doc,dof_flags);
}
public Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,
I64 dof_flags=DOF_MIN_SIZE,U8 *header=NULL,U8 *footer=NULL)
I64 dof_flags=DOF_SIZE_MIN,U8 *header=NULL,U8 *footer=NULL)
{//See $LK,"::/Demo/DolDoc/Form.HC"$ and $LK,"::/Demo/LastClass.HC"$.
return PopUpPrint("DocForm(0x%X,0x%X,0x%X,0x%X,0x%X);",_d,class_name,
dof_flags,header,footer);

10
Adam/DolDoc/DocGet.HC

@ -150,7 +150,7 @@ gs_done:
}
#help_index "Keyboard Devices;Char/Input;StdIn"
public I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=MIN_I64,I64 hi=MAX_I64)
public I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=I64_MIN,I64 hi=I64_MAX)
{//Prompt user for I64 expression.
Bool okay;
U8 *st;
@ -176,7 +176,7 @@ public I64 GetI64(U8 *msg=NULL,I64 dft=0,I64 lo=MIN_I64,I64 hi=MAX_I64)
}
}
public F64 GetF64(U8 *msg=NULL,F64 dft=0,F64 lo=MIN_F64,F64 hi=MAX_F64)
public F64 GetF64(U8 *msg=NULL,F64 dft=0,F64 lo=F64_MIN,F64 hi=F64_MAX)
{//Prompt user for F64 expression.
Bool okay;
U8 *st;
@ -202,12 +202,12 @@ public F64 GetF64(U8 *msg=NULL,F64 dft=0,F64 lo=MIN_F64,F64 hi=MAX_F64)
}
}
public CDate GetDate(U8 *msg=NULL,CDate dft=MIN_I64,
CDate lo=MIN_I64,CDate hi=MAX_I64)
public CDate GetDate(U8 *msg=NULL,CDate dft=I64_MIN,
CDate lo=I64_MIN,CDate hi=I64_MAX)
{//Prompt user for date expression. (Use $LK,"Now",A="MN:Now"$() if you want current time.)
U8 *st;
CDate res;
if (dft==MIN_I64) dft=Now;
if (dft==I64_MIN) dft=Now;
while (TRUE) {
if (msg)
"" msg,dft,dft;

6
Adam/DolDoc/DocGr.HC

@ -9,7 +9,7 @@ public I64 PopUpColor(U8 *header=NULL,
DocPrint(doc,"%s",header);
if (allow_transparent)
DocPrint(doc,"$$MU,\"TRANSPARENT\",LE=TRANSPARENT$$\n");
for (i=0;i<NUM_COLORS;i++)
for (i=0;i<COLORS_NUM;i++)
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-8Z__\",LE=%d$$$$BG$$\n",i,i,"ST_COLORS",i);
if (allow_dft)
DocPrint(doc,"$$BG,WHITE$$$$MU,\"DEFAULT\",LE=DOC_DFT$$$$BG$$");
@ -33,14 +33,14 @@ public I64 PopUpColorLighting(U8 *header=NULL)
"\n");
DocPrint(doc,
"\n$$LTPURPLE$$Single-Sided Full-Range Double-Sided Full-Range\n$$BLACK$$");
for (i=0;i<NUM_COLORS/2;i++) {
for (i=0;i<COLORS_NUM/2;i++) {
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",LE=%d$$$$BG$$ ",i,i,"ST_COLORS",i);
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",LE=%d$$$$BG$$\n",i,i,"ST_COLORS",
ROPF_TWO_SIDED+i);
}
DocPrint(doc,
"\n$$LTPURPLE$$Single-Sided Half-Range Double-Sided Half-Range\n$$BLACK$$");
for (i=0;i<NUM_COLORS;i++) {
for (i=0;i<COLORS_NUM;i++) {
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",LE=%d$$$$BG$$ ",
i,i,"ST_COLORS",ROPF_HALF_RANGE_COLOR+i);
DocPrint(doc,"$$BG,%d$$$$MU,\"__%-19Z__\",LE=%d$$$$BG$$\n",

27
Adam/DolDoc/DocHighlight.HC

@ -1,5 +1,10 @@
#help_index "DolDoc/Misc"
CColorROPU32 highlight_hash_type_colors[HTt_TYPES_NUM]=
DOC_COLOR_EXPORT_SYS_SYM,0,DOC_COLOR_DEFINE_STR,DOC_COLOR_GLBL_VAR,
DOC_COLOR_CLASS,DOC_COLOR_KEYWORD,DOC_COLOR_FUN,0,0,DOC_COLOR_KEYWORD,
DOC_COLOR_KEYWORD,DOC_COLOR_KEYWORD,DOC_COLOR_REG,0,0,0,0};
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _tmp_u32_attr)
{//Be aware of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
@ -35,12 +40,12 @@ hl_normal:
}
break;
case '\'':
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
tmp_u32_attr=DOC_COLOR_CHAR_CONST<<8|mask_tmp_u32_attr;
*dst++=ch1+tmp_u32_attr;
len--;
goto hl_single_quote;
case '\"':
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
tmp_u32_attr=DOC_COLOR_STR<<8|mask_tmp_u32_attr;
*dst++=ch1+tmp_u32_attr;
len--;
goto hl_dbl_quote;
@ -71,13 +76,13 @@ hl_normal:
}
ch=*src;
*src=0;
if (tmph=HashFind(ptr,cmp.asm_hash,
HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE|HTT_REG)) {
if (tmph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE))
tmp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_tmp_u32_attr;
else
tmp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_tmp_u32_attr;
} else
if (tmph=HashFind(ptr,adam_task->hash_table,
HTT_EXPORT_SYS_SYM|HTT_DEFINE_STR|HTT_GLBL_VAR|HTT_CLASS|
HTT_INTERNAL_TYPE|HTT_FUN|HTT_KEYWORD|HTT_ASM_KEYWORD|
HTT_OPCODE|HTT_REG))
tmp_u32_attr=highlight_hash_type_colors[HashTypeNum(tmph)]<<8|
mask_tmp_u32_attr;
else
tmp_u32_attr=_tmp_u32_attr;
while (ch1=*ptr++)
*dst++=ch1+tmp_u32_attr;
@ -88,7 +93,7 @@ hl_normal_done:
s->comment_depth=0;
break;
case DOCSS_SINGLE_QUOTE:
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
tmp_u32_attr=DOC_COLOR_CHAR_CONST<<8|mask_tmp_u32_attr;
hl_single_quote:
last_ch=0;
while (len--) {
@ -105,7 +110,7 @@ hl_single_quote:
s->comment_depth=0;
break;
case DOCSS_DBL_QUOTE:
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
tmp_u32_attr=DOC_COLOR_CHAR_CONST<<8|mask_tmp_u32_attr;
hl_dbl_quote:
last_ch=0;
while (len--) {

4
Adam/DolDoc/DocInit.HC

@ -42,11 +42,11 @@ U0 DocInit()
}
CmpCtrlDel(cc);
for (i=0;i<DOCT_NUM_TYPES;i++)
for (i=0;i<DOCT_TYPES_NUM;i++)
doldoc.dft_de_flags[i]&=~DOCG_BL_IV_UL;
doldoc.type_flags_form[0]=0;
for (i=0;i<DOCT_NUM_TYPES;i++)
for (i=0;i<DOCT_TYPES_NUM;i++)
if (Bt(&doldoc.dft_de_flags[i],DOCEf_TAG) && i!=DOCT_TEXT || i==DOCT_HEX_ED)
Bts(doldoc.type_flags_form,i);

2
Adam/DolDoc/DocMacro.HC

@ -157,7 +157,7 @@ I64 PopUpMacroMenu()
"$$CM+LX,1,3$$$$BT,\"STOP\",LE=SM_STOP$$"
"$$CM+LX,17,0$$$$BT,\"CANCEL\",LE=DOCM_CANCEL$$"
"\n\n\n$$GREEN$$SHIFT-F2$$FG$$ will play macro.\n");
doc->flags|=DOCF_MIN_SIZE | DOCF_FORM;
doc->flags|=DOCF_SIZE_MIN | DOCF_FORM;
StrPrint(buf,"DocMenu(%d);",doc);
sys_macro_task=Spawn(&SrvCmdLine,NULL,"Macro Popup",,Fs);
Fs->popup_task=sys_macro_task;

4
Adam/DolDoc/DocNew.HC

@ -276,7 +276,7 @@ public U0 DocRst(CDoc *doc,Bool is_old)
doc->dollar_buf_ptr=0;
doc->cmd_U8=CH_SPACE;
doc->page_line_num=0;
doc->best_d=MAX_I64;
doc->best_d=I64_MAX;
s=&doc->settings_head;
s->left_margin=DOC_DFT;
@ -376,7 +376,7 @@ public CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL)
doc->left_click_link=&EdLeftClickLink;
doc->dollar_buf_size=84;
doc->dollar_buf=MAlloc(doc->dollar_buf_size,task);
doc->max_entries=MAX_I64;
doc->max_entries=I64_MAX;
doc->win_task=task;
doc->mem_task=task;
DocRst(doc,FALSE);

14
Adam/DolDoc/DocPlain.HC

@ -47,7 +47,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
U8 *buf,*buf2;
if (doc_e->type_u8==DOCT_FOREGROUND &&
doc->flags&DOCF_COLOR_NAMES && 0<=attr<NUM_COLORS) {
doc->flags&DOCF_COLOR_NAMES && 0<=attr<COLORS_NUM) {
buf=StrNew(DefineSub(attr,"ST_COLORS"));
attr=DOC_DFT;
} else
@ -58,7 +58,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
de_flags=doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_SEL|
DOCEF_HIGHLIGHT|DOCEF_WORD_WRAP|DOCEF_SKIP|DOCEF_FILTER_SKIP);
for (i=0;i<DOCEf_NUM_FLAGS;i++)
for (i=0;i<DOCEf_FLAGS_NUM;i++)
if (Bt(&f1,i)!=Bt(&de_flags,i)) {
if (Bt(&de_flags,i)) {
if (!(1<<i&DOCEG_HAS_ARG)) {
@ -92,7 +92,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
case DOCT_BACKGROUND:
case DOCT_DFT_FOREGROUND:
case DOCT_DFT_BACKGROUND:
if (doc->flags&DOCF_COLOR_NAMES && 0<=attr<NUM_COLORS) {
if (doc->flags&DOCF_COLOR_NAMES && 0<=attr<COLORS_NUM) {
buf2=MStrPrint("%s%Z,",buf,doc_e->attr,"ST_COLORS");
Free(buf); buf=buf2;
break;
@ -114,7 +114,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
buf2=MStrPrint("%s%d,",buf,doc_e->attr);
Free(buf); buf=buf2;
}
case DOCT_NUM_TYPES-1: //nobound switch
case DOCT_TYPES_NUM-1: //nobound switch
break;
}
de_flags=doc_e->de_flags & DOCEG_HAS_ARG;
@ -202,7 +202,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
case DOCEf_USER_DATA:
buf2=MStrPrint("%sU=0x%X,",buf,doc_e->user_data);
break;
case DOCEf_NUM_FLAGS-1: //nobound switch
case DOCEf_FLAGS_NUM-1: //nobound switch
break;
}
Free(buf); buf=buf2;
@ -285,7 +285,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
else
doc_e->attr=attr;
break;
#assert DOCT_ERROR==DOCT_NUM_TYPES-1
#assert DOCT_ERROR==DOCT_TYPES_NUM-1
case DOCT_ERROR:
goto pd_err;
}
@ -460,7 +460,7 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
else
goto pd_err;
break;
case DOCEf_NUM_FLAGS-1: //nobound switch
case DOCEf_FLAGS_NUM-1: //nobound switch
break;
}
}

6
Adam/DolDoc/DocPopUp.HC

@ -74,7 +74,7 @@ public U8 *FileNameForm(U8 *dft=NULL,I64 dof_flags=0,CTask *mem_task=NULL)
public U8 *PopUpFileName(U8 *dft=NULL,I64 dof_flags=0)
{//Filename chooser. Uses form, not $LK,"FileMgr",A="MN:FileMgr"$().
U8 *st=MStrPrint("FileNameForm(\"%Q\",0x%X,Fs->parent_task);",
dft,dof_flags|DOF_MIN_SIZE),*res=PopUp(st,Fs);
dft,dof_flags|DOF_SIZE_MIN),*res=PopUp(st,Fs);
Free(st);
return res;
}
@ -184,7 +184,7 @@ public U8 *PopUpGetStr(U8 *header=NULL)
return res;
}
public I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64)
public I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=I64_MIN,I64 hi=I64_MAX)
{//Prompt for I64 text expression in PopUp win task.
U8 *st=MStrPrint("GetI64(0x%X,0x%X,0x%X,0x%X);",msg,dft,lo,hi);
I64 res=PopUp(st,Fs);
@ -192,7 +192,7 @@ public I64 PopUpGetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64)
return res;
}
public F64 PopUpGetF64(U8 *msg,F64 dft,F64 lo=MIN_F64,F64 hi=MAX_F64)
public F64 PopUpGetF64(U8 *msg,F64 dft,F64 lo=F64_MIN,F64 hi=F64_MAX)
{//Prompt for F64 text expression in PopUp win task.
U8 *st=MStrPrint("GetF64(0x%X,0x%X(F64),0x%X(F64),0x%X(F64));",msg,dft,lo,hi);
F64 res=PopUp(st,Fs)(F64);

14
Adam/DolDoc/DocRecalc.HC

@ -255,9 +255,9 @@ I64 DocTmpAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr)
public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
{//Recalc and fmt. Also used by WinMgr to draw on scrn.
I64 i,ii,j,k,x,x0,y,y0,D,d2,col,col2,best_col=0,best_d=MAX_I64,xx,yy,zz,
I64 i,ii,j,k,x,x0,y,y0,D,d2,col,col2,best_col=0,best_d=I64_MAX,xx,yy,zz,
num_entries=0,i_jif,cur_u8_attr,tmp_u32_attr,
cursor_y=MIN_I64,left_margin,right_margin,y_plot_top,y_plot_bottom,
cursor_y=I64_MIN,left_margin,right_margin,y_plot_top,y_plot_bottom,
top,left,bottom,right,width,height,scroll_x,scroll_y,pix_top,pix_left;
CDocEntry reg *doc_e,reg *doc_e2,*best_doc_e,*next_clear_found=NULL,
*added_cursor=NULL;
@ -422,8 +422,8 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
skipped_update= doc_e==doc && doc->head.next!=doc;
if (full_refresh) {
doc->min_x=MAX_I32; doc->min_y=MAX_I32;
doc->max_x=MIN_I32; doc->max_y=MIN_I32;
doc->min_x=I32_MAX; doc->min_y=I32_MAX;
doc->max_x=I32_MIN; doc->max_y=I32_MIN;
}
while (doc_e!=doc) {
while (TRUE) {
@ -967,7 +967,7 @@ rc_adjust_xy:
dc->flags|=DCF_DONT_DRAW;
bptr=tmpb->data;
ii=SpriteTypeMask(bptr);
if (ii&1<<SPT_NUM_TYPES) {
if (ii&1<<SPT_TYPES_NUM) {
bptr=gr.empty_sprite;
ii=SpriteTypeMask(bptr);
}
@ -1042,7 +1042,7 @@ rc_adjust_xy:
doc_e->de_flags&DOCEF_TAG && doc_e->tag)
x-=StrLen(doc_e->tag);
break;
case DOCT_NUM_TYPES-1: //nobound switch
case DOCT_TYPES_NUM-1: //nobound switch
default:
break;
}
@ -1178,7 +1178,7 @@ rc_skip:
}
}
}
if (doc->flags & DOCF_MIN_SIZE) {
if (doc->flags & DOCF_SIZE_MIN) {
if (Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
if (left<0)
left=0;

2
Adam/DolDoc/DocRecalcLib.HC

@ -173,7 +173,7 @@ public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL)
}
#help_index "DolDoc/Cmd Line (Typically);Cmd Line (Typically)"
public I64 DocMax(I64 i=MAX_I64)
public I64 DocMax(I64 i=I64_MAX)
{//Set max document entries. (Cmd line buffer size.)
//Adjusts the size of the cmd line buf.
//Normally, the cmd line deletes entries

2
Adam/DolDoc/DocTree.HC

@ -60,7 +60,7 @@ ft_done:
public Bool DocTreeMake(CDoc *doc,U8 *path)
{//Make registry-like tree widget.
I64 i=0,j=MIN_I64,k=0;
I64 i=0,j=I64_MIN,k=0;
U8 *st1=StrNew(path),
*st2=MAlloc(StrLen(path)+1),
*st3=StrNew(path);

12
Adam/DolDoc/MakeDoc.HC

@ -21,13 +21,13 @@ See $LK,"::/Doc/DolDocOverview.DD"$
public class CDolDocGlbls
{
CHashTable *hash;
I64 dft_de_flags [DOCT_NUM_TYPES],
type_flags_nontag_invis [(DOCT_NUM_TYPES+63)/64],
type_flags_form [(DOCT_NUM_TYPES+63)/64],
type_flags_data [(DOCT_NUM_TYPES+63)/64],
type_flags_chk_dup [(DOCT_NUM_TYPES+63)/64],
I64 dft_de_flags [DOCT_TYPES_NUM],
type_flags_nontag_invis [(DOCT_TYPES_NUM+63)/64],
type_flags_form [(DOCT_TYPES_NUM+63)/64],
type_flags_data [(DOCT_TYPES_NUM+63)/64],
type_flags_chk_dup [(DOCT_TYPES_NUM+63)/64],
clean_scan_codes [4];
I32 dft_type_flags [DOCT_NUM_TYPES];
I32 dft_type_flags [DOCT_TYPES_NUM];
} doldoc;
MemSet(&doldoc,0,sizeof(CDolDocGlbls));

2
Adam/God/GodExt.HC

@ -19,8 +19,8 @@ MemSet(&god,0,sizeof(CGodGlbls));
god.doodle_fifo =FifoU8New(2048*8);
god.fifo =FifoU8New(2048*8);
extern U0 GodBiblePassage(I64 num_lines=20);
extern U0 GodBitsIns(I64 num_bits,I64 n);
extern U0 GodDoodle(U8 *hex=NULL);
extern U0 GodBiblePassage(I64 num_lines=20);
extern U0 GodSong();
extern U0 GodWord(I64 bits=17,Bool show_num=FALSE);

2
Adam/Gr/Gr.HH

@ -147,7 +147,7 @@ public class CSpritePtMeshU8s : CSpriteBase
#define SPT_TEXT 27 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
#define SPT_TEXT_BOX 28 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
#define SPT_TEXT_DIAMOND 29 //$LK,"CSpritePtStr",A="MN:CSpritePtStr"$
#define SPT_NUM_TYPES 30
#define SPT_TYPES_NUM 30
#define SPG_TYPE_MASK 0x7F
#help_index "Graphics/Sprite;Sprites;Sprites/Binary"

14
Adam/Gr/GrComposites.HC

@ -178,7 +178,7 @@ public Bool GrTextBox3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,U8 *s,I64 border=2)
return ToBool(res);
}
#define MAX_DIAMOND_SLOPE 2.75
#define DIAMOND_SLOPE_MAX 2.75
public Bool GrTextDiamond3(CDC *dc=gr.dc,
I64 x1,I64 y1,I64 z1,U8 *_s,I64 border=2)
@ -223,12 +223,12 @@ public Bool GrTextDiamond3(CDC *dc=gr.dc,
do {
dx_old=dx; dy_old=dy;
m=ToF64(dx)/dy;
if (m<1/MAX_DIAMOND_SLOPE) {
dy=MaxI64(dy,Ceil(MAX_DIAMOND_SLOPE*dx));
m=1/MAX_DIAMOND_SLOPE;
} else if (m>MAX_DIAMOND_SLOPE) {
dy=MaxI64(dy,Ceil(dx/MAX_DIAMOND_SLOPE));
m=MAX_DIAMOND_SLOPE;
if (m<1/DIAMOND_SLOPE_MAX) {
dy=MaxI64(dy,Ceil(DIAMOND_SLOPE_MAX*dx));
m=1/DIAMOND_SLOPE_MAX;
} else if (m>DIAMOND_SLOPE_MAX) {
dy=MaxI64(dy,Ceil(dx/DIAMOND_SLOPE_MAX));
m=DIAMOND_SLOPE_MAX;
}
dx=MaxI64(dx,w+Ceil(m*AbsI64(y-y1)));
dx=MaxI64(dx,w+Ceil(m*AbsI64(y+FONT_HEIGHT-y1)));

30
Adam/Gr/GrDC.HC

@ -149,7 +149,7 @@ public U0 DCRst(CDC *dc)
Mat4x4IdentEqu(dc->r);
dc->r_norm=GR_SCALE;
dc->flags&=~(DCF_SYMMETRY|DCF_TRANSFORMATION|DCF_JUST_MIRROR);
MemCpy(dc->palette,gr_palette_std,sizeof(CBGR48)*NUM_COLORS);
MemCpy(dc->palette,gr_palette_std,sizeof(CBGR48)*COLORS_NUM);
}
public U0 DCExtentsInit(CDC *dc=NULL)
@ -159,10 +159,10 @@ public U0 DCExtentsInit(CDC *dc=NULL)
//You should clear the record flag yourself
if (!dc) dc=gr.dc;
dc->flags|=DCF_RECORD_EXTENTS;
dc->min_x=MAX_I64;
dc->max_x=MIN_I64;
dc->min_y=MAX_I64;
dc->max_y=MIN_I64;
dc->min_x=I64_MAX;
dc->max_x=I64_MIN;
dc->min_y=I64_MAX;
dc->max_y=I64_MIN;
}
public CDC *DCAlias(CDC *dc=NULL,CTask *task=NULL)
@ -229,7 +229,7 @@ public I64 DCSize(CDC *dc)
public I32 *DCDepthBufRst(CDC *dc)
{//Reset device context depth buf to far away.
if (dc->depth_buf)
MemSetU32(dc->depth_buf,MAX_I32,dc->width_internal*dc->height);
MemSetU32(dc->depth_buf,I32_MAX,dc->width_internal*dc->height);
return dc->depth_buf;
}
@ -288,7 +288,7 @@ public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED)
U8 *res,*ptr,*body;
CArcCompress *arc;
I64 body_size=dc->width_internal*dc->height,total_size,flags;
CBGR48 palette[NUM_COLORS];
CBGR48 palette[COLORS_NUM];
if (dcsf_flags&DCSF_COMPRESSED) {
arc=CompressBuf(dc->body,body_size);
@ -308,10 +308,10 @@ public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED)
if (dcsf_flags&DCSF_PALETTE_GET)
GrPaletteGet(palette);
else
MemCpy(palette,&dc->palette,NUM_COLORS*sizeof(CBGR48));
if (MemCmp(palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48))) {
MemCpy(palette,&dc->palette,COLORS_NUM*sizeof(CBGR48));
if (MemCmp(palette,gr_palette_std,COLORS_NUM*sizeof(CBGR48))) {
flags|=DCF_PALETTE;
total_size+=NUM_COLORS*sizeof(CBGR48);
total_size+=COLORS_NUM*sizeof(CBGR48);
}
ptr=res=MAlloc(total_size);
@ -323,8 +323,8 @@ public U8 *DCSave(CDC *dc,I64 *_size=NULL,I64 dcsf_flags=DCSF_COMPRESSED)
#assert offset(CDC.end)==offset(CDC.palette)
if (flags&DCF_PALETTE) {
MemCpy(ptr,palette,NUM_COLORS*sizeof(CBGR48));
ptr+=NUM_COLORS*sizeof(CBGR48);
MemCpy(ptr,palette,COLORS_NUM*sizeof(CBGR48));
ptr+=COLORS_NUM*sizeof(CBGR48);
}
MemCpy(ptr,body,body_size);
@ -349,10 +349,10 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
ptr+=offset(CDC.end)-offset(CDC.start);
if (res->flags&DCF_PALETTE) {
MemCpy(&res->palette,ptr,NUM_COLORS*sizeof(CBGR48));
ptr+=NUM_COLORS*sizeof(CBGR48);
MemCpy(&res->palette,ptr,COLORS_NUM*sizeof(CBGR48));
ptr+=COLORS_NUM*sizeof(CBGR48);
} else
MemCpy(&res->palette,gr_palette_std,NUM_COLORS*sizeof(CBGR48));
MemCpy(&res->palette,gr_palette_std,COLORS_NUM*sizeof(CBGR48));
body_size=res->width_internal*res->height;
if (res->flags&DCF_COMPRESSED) {

20
Adam/Gr/GrGlbls.HC

@ -25,16 +25,16 @@ public class CGrGlbls
U0 (*fp_draw_grab_ms)(CDC *dc,I64 x,I64 y,Bool closed);
U8 *empty_sprite; //Gets assigned $LK,"gr.empty_sprite",A="FF:::/Adam/AMouse.HC,empty_sprite"$
#define GR_NUM_PEN_BRUSHES 64
CDC *pen_brushes[GR_NUM_PEN_BRUSHES],
*collision_pen_brushes[GR_NUM_PEN_BRUSHES],
*even_pen_brushes[GR_NUM_PEN_BRUSHES],
*odd_pen_brushes[GR_NUM_PEN_BRUSHES];
I8 circle_lo[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES],
circle_hi[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES];
#define GR_MAX_SCRN_ZOOM 8
U8 *scrn_zoom_tables[GR_MAX_SCRN_ZOOM+1];
#define GR_PEN_BRUSHES_NUM 64
CDC *pen_brushes[GR_PEN_BRUSHES_NUM],
*collision_pen_brushes[GR_PEN_BRUSHES_NUM],
*even_pen_brushes[GR_PEN_BRUSHES_NUM],
*odd_pen_brushes[GR_PEN_BRUSHES_NUM];
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;
//When zoomed, this keeps the mouse centered.

4
Adam/Gr/GrInitB.HC

@ -18,7 +18,7 @@ U0 GrSetUpTables()
for (j=0;j<8;j++)
gr.to_8_colors(U8 *)[k++]=i;
for (i=0;i<GR_NUM_PEN_BRUSHES;i++) {
for (i=0;i<GR_PEN_BRUSHES_NUM;i++) {
k=i+1;
rr=k*k;
@ -77,7 +77,7 @@ U0 GrSetUpTables()
// MemSet(text.vga_alias,0,GR_HEIGHT*GR_WIDTH>>3);
MemSet(gr.scrn_image->body,0,GR_WIDTH*GR_HEIGHT>>1);
}
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++) {
for (i=1;i<=GR_SCRN_ZOOM_MAX;i++) {
dst=gr.scrn_zoom_tables[i]=MAlloc(256*i);
for (j=0;j<256;j++) {
m=0;

10
Adam/Gr/GrPalette.HC

@ -16,7 +16,7 @@ U0 GrPaletteIndicesSet()
while (LBts(&sys_semas[SEMA_VGA],0))
Yield;
InU8(VGAP_INPUT_STAT); //Rsts attr index/data
for (i=0;i<NUM_COLORS;i++) {
for (i=0;i<COLORS_NUM;i++) {
OutU8(VGAP_ATTR_INDEX,i);
OutU8(VGAP_ATTR_DATA_WRITE,i);
}
@ -61,13 +61,13 @@ public CBGR48 GrPaletteColorGet(I64 color_num)
return res;
}
public CBGR48 gr_palette_std[NUM_COLORS]={
public CBGR48 gr_palette_std[COLORS_NUM]={
0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA,
0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA,
0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF,
0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF};
public CBGR48 gr_palette_gray[NUM_COLORS]={
public CBGR48 gr_palette_gray[COLORS_NUM]={
0x000000000000,0x111111111111,0x222222222222,0x333333333333,
0x444444444444,0x555555555555,0x666666666666,0x777777777777,
0x888888888888,0x999999999999,0xAAAAAAAAAAAA,0xBBBBBBBBBBBB,
@ -76,14 +76,14 @@ public CBGR48 gr_palette_gray[NUM_COLORS]={
public U0 GrPaletteGet(CBGR48 *bgr48)
{//16 colors
I64 i;
for (i=0;i<NUM_COLORS;i++)
for (i=0;i<COLORS_NUM;i++)
bgr48[i]=GrPaletteColorGet(i);
}
public U0 GrPaletteSet(CBGR48 *bgr48)
{//16 colors
I64 i;
for (i=0;i<NUM_COLORS;i++)
for (i=0;i<COLORS_NUM;i++)
GrPaletteColorSet(i,bgr48[i]);
}

20
Adam/Gr/GrPrimatives.HC

@ -280,7 +280,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
if (diameter>=1)
switch (n) {
case 0:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=0;i<r;i++)
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
@ -293,7 +293,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
}
break;
case 1:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=r+1;i<diameter;i++)
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
@ -306,7 +306,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
}
break;
case 2:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=0;i<r;i++)
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
gr.circle_hi[diameter][i]+cy,z,z);
@ -319,7 +319,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
}
break;
case 3:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=r+1;i<diameter;i++)
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
gr.circle_hi[diameter][i]+cy,z,z);
@ -332,7 +332,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
}
break;
case 4:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=0;i<r;i++)
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
@ -345,7 +345,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
}
break;
case 5:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=r+1;i<diameter;i++)
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
@ -358,7 +358,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
}
break;
case 6:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=0;i<r;i++)
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
gr.circle_hi[diameter][i]+cy,z,z);
@ -371,7 +371,7 @@ I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
}
break;
case 7:
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=r+1;i<diameter;i++)
res+=GrVLine(dc,cx+i-r,gr.circle_lo[diameter][i]+cy,
gr.circle_hi[diameter][i]+cy,z,z);
@ -391,7 +391,7 @@ public I64 GrFillCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter)
{//2D. Clipping but not transformation.
I64 res=0,i,k,r=diameter>>1,rr;
if (diameter>=1) {
if (diameter<GR_NUM_PEN_BRUSHES)
if (diameter<GR_PEN_BRUSHES_NUM)
for (i=0;i<diameter;i++)
res+=GrHLine(dc,gr.circle_lo[diameter][i]+cx,
gr.circle_hi[diameter][i]+cx,cy+i-r,z,z);
@ -462,7 +462,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
dc->db_z=z;
if (dc->brush || w<=0)
GrPlot1(dc,x,y);
else if (dc->pen_width<GR_NUM_PEN_BRUSHES) {
else if (dc->pen_width<GR_PEN_BRUSHES_NUM) {
if (dc->color.c0.rop!=ROPB_COLLISION)
dc->color.c0.rop=ROPB_MONO;
if (dc->depth_buf) {

2
Adam/Gr/GrScrn.HC

@ -94,7 +94,7 @@ U0 GrUpdateTasks()
U0 GrFixZoomScale()
{
gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_MAX_SCRN_ZOOM);
gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_SCRN_ZOOM_MAX);
if (gr.scrn_zoom==1) {
gr.sx=0;
gr.sy=0;

14
Adam/Gr/GrSpritePlot.HC

@ -28,7 +28,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
CGrSym old_sym;
MemCpy(&old_sym,&dc->sym,sizeof(CGrSym));
if (dc->flags & DCF_LOCATE_NEAREST)
dc->nearest_dist=MAX_I64;
dc->nearest_dist=I64_MAX;
while (tmpg->type&SPG_TYPE_MASK) {
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_COLOR:
@ -293,16 +293,16 @@ public U0 Sprite3ZB(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,F64
public U0 SpriteExtents(U8 *elems,I64 *min_x=NULL,I64 *max_x=NULL,
I64 *min_y=NULL,I64 *max_y=NULL)
{//Ignores flood fills.
CDC *dc=DCNew(MAX_I32,MAX_I32,Fs,TRUE);
CDC *dc=DCNew(I32_MAX,I32_MAX,Fs,TRUE);
DCExtentsInit(dc);
Sprite3(dc,MAX_I32/2,MAX_I32/2,MAX_I32/2,elems);
Sprite3(dc,I32_MAX/2,I32_MAX/2,I32_MAX/2,elems);
if (dc->min_x<=dc->max_x) {
dc->min_x-=MAX_I32/2;
dc->max_x-=MAX_I32/2;
dc->min_x-=I32_MAX/2;
dc->max_x-=I32_MAX/2;
}
if (dc->min_y<=dc->max_y) {
dc->min_y-=MAX_I32/2;
dc->max_y-=MAX_I32/2;
dc->min_y-=I32_MAX/2;
dc->max_y-=I32_MAX/2;
}
if (min_x) *min_x=dc->min_x;
if (max_x) *max_x=dc->max_x;

4
Adam/Gr/SpriteEd.HC

@ -661,7 +661,7 @@ U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num)
CDocEntry *doc_e;
CDoc *doc=DocPut;
Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs);
doc->flags|=DOCF_MIN_SIZE|DOCF_FORM;
doc->flags|=DOCF_SIZE_MIN|DOCF_FORM;
while (TRUE) {
SpriteSideBarPickNew(doc,*_head,*_cur_elem_num);
DocHighlightCursor(,doc);
@ -977,7 +977,7 @@ Bool SpriteSelUnselShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
case SPED_UNSEL:
case SPED_SHIFT_PTS:
xx=arg1; yy=arg2;
best_dd=MAX_I64;
best_dd=I64_MAX;
tmpes=head.next;
while (tmpes!=&head) {
switch (tmpes->type) {

8
Adam/Gr/SpriteMesh.HC

@ -76,7 +76,7 @@ CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,