TempleOSCDV5.01.ISO
This commit is contained in:
1 parent
f6eacf7744
commit
320c7ee98a
219 files changed
+5211
-4853
No files matched your search
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
+50
-34
@@ -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);
|
||||
|
||||
@@ -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):";
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
+6
-4
@@ -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,...);
|
||||
|
||||
+4
-4
@@ -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",
|
||||
|
||||
+3
-3
@@ -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) {
|
||||
|
||||
+35
-14
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
|
||||
+16
-11
@@ -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--) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
+1
-1
@@ -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"
|
||||
|
||||
@@ -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)));
|
||||
|
||||
+15
-15
@@ -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) {
|
||||
|
||||
+9
-9
@@ -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_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_MAX_SCRN_ZOOM 8
|
||||
U8 *scrn_zoom_tables[GR_MAX_SCRN_ZOOM+1];
|
||||
#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.
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
|
||||
@@ -76,7 +76,7 @@ CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,
|
||||
CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
|
||||
{//Scrn coordinates
|
||||
CMeshEdVertex *res=NULL,*tmpv=e->vertex_head.next;
|
||||
I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64;
|
||||
I64 dd,dz,best_dd=I64_MAX,best_dz=I64_MAX;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (!(tmpv->flags&VF_IGNORE)) {
|
||||
dd=SqrI64(x-tmpv->pt.x)+SqrI64(y-tmpv->pt.y);
|
||||
@@ -1358,7 +1358,7 @@ me_clipboard_cut:
|
||||
p0b.y=ms.presnap.y;
|
||||
p0b.z=e.ms_z;
|
||||
adjusting_z=TRUE;
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,MAX_I8));
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1432,7 +1432,7 @@ me_clipboard_cut:
|
||||
p0b.y=ms.presnap.y;
|
||||
p0b.z=e.ms_z;
|
||||
adjusting_z=TRUE;
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,MAX_I8));
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
|
||||
}
|
||||
break;
|
||||
case MSG_MS_R_UP:
|
||||
@@ -1472,7 +1472,7 @@ me_clipboard_cut:
|
||||
e.ms_z=RoundI64(Sign(p0b.y-ms.presnap.y)
|
||||
*Sqrt(Sqr(p0b.x-ms.presnap.x)+Sqr(p0b.y-ms.presnap.y))
|
||||
+p0b.z,e.cur_snap);
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,MAX_I8));
|
||||
Snd(ClampI64(Freq2Ona(3*e.ms_z+1500),0,I8_MAX));
|
||||
}
|
||||
if (moving) {
|
||||
MeshCursorW(&e,Fs,&x,&y,&z);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
U8 polypt_map[9]={0,1,2,3,0,4,5,6,7};
|
||||
|
||||
I64 sprite_elem_base_sizes[SPT_NUM_TYPES]={
|
||||
I64 sprite_elem_base_sizes[SPT_TYPES_NUM]={
|
||||
sizeof(CSpriteBase), //SPT_END
|
||||
sizeof(CSpriteColor), //SPT_COLOR
|
||||
sizeof(CSpriteDitherColor), //SPT_DITHER_COLOR
|
||||
@@ -90,8 +90,8 @@ I64 SpriteTypeMask(U8 *elems)
|
||||
I64 res=0;
|
||||
CSprite *tmpg=elems-offset(CSprite.start);
|
||||
while (tmpg->type&SPG_TYPE_MASK) {
|
||||
if (tmpg->type&SPG_TYPE_MASK>=SPT_NUM_TYPES)
|
||||
return 1<<SPT_NUM_TYPES;
|
||||
if (tmpg->type&SPG_TYPE_MASK>=SPT_TYPES_NUM)
|
||||
return 1<<SPT_TYPES_NUM;
|
||||
Bts(&res,tmpg->type&SPG_TYPE_MASK);
|
||||
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ public Bool HostChgDsk(U8 *iso_filename)
|
||||
WinBorder;
|
||||
WinMax;
|
||||
DocClear;
|
||||
"$$PURPLE$$$$TX+CX,\"Change CD/DVD\"$$$$FG$$\n\n\n\n";
|
||||
"$$PURPLE$$$$TX+CX,\"Set to %s\"$$$$FG$$\n\n\n\n",iso_filename;
|
||||
switch (ins_reg.host_vm) {
|
||||
case VM_VMWARE:
|
||||
if (IsDotC(iso_filename))
|
||||
|
||||
+3
-3
@@ -122,14 +122,14 @@ Bool InSetMsPlot(I64 mS,I64 x,I64 y,I64 z)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public U0 InSetMs(I64 mS=7,I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,
|
||||
I64 l=MAX_I64,I64 r=MAX_I64)
|
||||
public U0 InSetMs(I64 mS=7,I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,
|
||||
I64 l=I64_MAX,I64 r=I64_MAX)
|
||||
{//Move mouse to spot at certain speed.
|
||||
if (!(0<=x<GR_WIDTH))
|
||||
x=ms.pos.x;
|
||||
if (!(0<=y<GR_HEIGHT))
|
||||
y=ms.pos.y;
|
||||
if (z==MAX_I64)
|
||||
if (z==I64_MAX)
|
||||
z=ms.pos.z;
|
||||
if (!(FALSE<=l<=TRUE))
|
||||
l=ms.lb;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
#help_index "Misc/Install Registration"
|
||||
#help_index "Registry/Install Registration"
|
||||
|
||||
public CInsReg ins_reg;
|
||||
MemSet(&ins_reg,0,sizeof(CInsReg));
|
||||
@@ -31,7 +31,7 @@ public Bool InsReg(U8 drv_let=0,I64 action=RR_REGISTER)
|
||||
if (drv_let)
|
||||
*sys_registry_doc->filename.name=drv_let;
|
||||
RegWrite("Adam/InsReg",
|
||||
"#help_index \"Misc/Install Registration\"\n"
|
||||
"#help_index \"Registry/Install Registration\"\n"
|
||||
"MemSet(&ins_reg,0,sizeof(CInsReg));\n"
|
||||
"ins_reg.registered=%d;\n"
|
||||
"ins_reg.host_os=%d;\n"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//See $LK,"Install Documentation",A="FI:::/Doc/Install.DD"$ or $LK,"Upgrading Documentation",A="FI:::/Doc/Upgrade.DD"$.
|
||||
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$
|
||||
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$
|
||||
|
||||
#include "BootDVD"
|
||||
#include "DskISORedSea"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//See $LK,"Install Documentation",A="FI:::/Doc/Install.DD"$ or $LK,"Upgrading Documentation",A="FI:::/Doc/Upgrade.DD"$.
|
||||
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$
|
||||
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$
|
||||
|
||||
#include "BootHD"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//See $LK,"Install Documentation",A="FI:::/Doc/Install.DD"$ or $LK,"Upgrading Documentation",A="FI:::/Doc/Upgrade.DD"$.
|
||||
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$
|
||||
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$
|
||||
|
||||
#include "BootMHD"
|
||||
#include "BootMHD2"
|
||||
|
||||
@@ -36,7 +36,7 @@ public U0 BootRAM(U8 *filename=NULL)
|
||||
CKernel *hi_image,*lo_image=mem_boot_base-sizeof(CBinFile),
|
||||
reg *sys_ram_reboot;
|
||||
if (!filename)
|
||||
filename="::/Kernel/" KERNEL_BIN_C;
|
||||
filename="::/" KERNEL_BIN_C;
|
||||
do if (!(hi_image=FileRead(filename,&size))) return;
|
||||
while (hi_image<0x100000); //If alloc from low 640K, just get another copy.
|
||||
|
||||
|
||||
@@ -142,43 +142,47 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
|
||||
CDrv *dv=DrvMakeFreeSlot(DrvNextFreeLet('Q')); //First $LK,"BDT_ISO_FILE_WRITE",A="MN:BDT_ISO_FILE_WRITE"$
|
||||
CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_WRITE);
|
||||
|
||||
if (!_iso_filename)
|
||||
_iso_filename=blkdev.dft_iso_filename;
|
||||
iso_filename=ChgExt(_iso_filename,"ISO.C");
|
||||
src_dir=DirNameAbs(_src_dir);
|
||||
if (_stage2_filename) {
|
||||
stage2_filename=FileNameAbs(_stage2_filename);
|
||||
*stage2_filename=dv->drv_let;
|
||||
i=StrLen(src_dir);
|
||||
if (i!=3) //If not head
|
||||
i++; //Skip slash
|
||||
StrCpy(stage2_filename+3,stage2_filename+i);
|
||||
} else
|
||||
stage2_filename=NULL;
|
||||
tmpde=FilesFind(src_dir,FUF_RECURSE);
|
||||
root_cnt=LinkedLstCnt(tmpde)+3;
|
||||
root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
|
||||
if (res=RedSeaISOPass1(tmpde)>>BLK_SIZE_BITS) {
|
||||
bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
|
||||
bitmap_blks=1;
|
||||
do {
|
||||
bitmap_blks1=bitmap_blks;
|
||||
bitmap_blks=(res+bitmap_blks+BLK_SIZE<<3-1)/BLK_SIZE<<3;
|
||||
} while (bitmap_blks!=bitmap_blks1);
|
||||
if (!IsDir(_src_dir))
|
||||
PrintErr("'%s' is not a dir.\n",_src_dir);
|
||||
else {
|
||||
if (!_iso_filename)
|
||||
_iso_filename=blkdev.dft_iso_c_filename;
|
||||
iso_filename=ChgExt(_iso_filename,"ISO.C");
|
||||
src_dir=DirNameAbs(_src_dir);
|
||||
if (_stage2_filename) {
|
||||
stage2_filename=FileNameAbs(_stage2_filename);
|
||||
*stage2_filename=dv->drv_let;
|
||||
i=StrLen(src_dir);
|
||||
if (i!=3) //If not root
|
||||
i++; //Skip slash
|
||||
StrCpy(stage2_filename+3,stage2_filename+i);
|
||||
} else
|
||||
stage2_filename=NULL;
|
||||
tmpde=FilesFind(src_dir,FUF_RECURSE);
|
||||
root_cnt=LinkedLstCnt(tmpde)+3;
|
||||
root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
|
||||
if (res=RedSeaISOPass1(tmpde)>>BLK_SIZE_BITS) {
|
||||
bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
|
||||
bitmap_blks=1;
|
||||
do {
|
||||
bitmap_blks1=bitmap_blks;
|
||||
bitmap_blks=(res+bitmap_blks+BLK_SIZE<<3-1)/BLK_SIZE<<3;
|
||||
} while (bitmap_blks!=bitmap_blks1);
|
||||
|
||||
bd->max_blk=CeilI64(bd->drv_offset+1+bitmap_blks+res,4);
|
||||
bd->max_blk--; //Inclusive.
|
||||
bd->file_dsk_name=AStrNew(iso_filename);
|
||||
bd->init_root_dir_blks=root_dir_blks;
|
||||
BlkDevAdd(bd,,TRUE,TRUE);
|
||||
StrPrint(buf,"%C:/",dv->drv_let);
|
||||
CopyTree(src_dir,buf,TRUE);
|
||||
RedSeaISO9660Stage1(iso_filename,stage2_filename);
|
||||
DrvDel(dv);
|
||||
BlkDevDel(bd);
|
||||
bd->max_blk=CeilI64(bd->drv_offset+1+bitmap_blks+res,4);
|
||||
bd->max_blk--; //Inclusive.
|
||||
bd->file_dsk_name=AStrNew(iso_filename);
|
||||
bd->init_root_dir_blks=root_dir_blks;
|
||||
BlkDevAdd(bd,,TRUE,TRUE);
|
||||
StrPrint(buf,"%C:/",dv->drv_let);
|
||||
CopyTree(src_dir,buf,TRUE);
|
||||
RedSeaISO9660Stage1(iso_filename,stage2_filename);
|
||||
DrvDel(dv);
|
||||
BlkDevDel(bd);
|
||||
}
|
||||
Free(stage2_filename);
|
||||
Free(src_dir);
|
||||
Free(iso_filename);
|
||||
}
|
||||
Free(stage2_filename);
|
||||
Free(src_dir);
|
||||
Free(iso_filename);
|
||||
return res;
|
||||
}
|
||||
+17
-17
@@ -1,6 +1,6 @@
|
||||
#help_index "Graphics/Windows BMP Files"
|
||||
|
||||
#define NUM_BMP_COLORS 16
|
||||
#define BMP_COLORS_NUM 16
|
||||
|
||||
class CFileBMP
|
||||
{
|
||||
@@ -23,13 +23,13 @@ class CFileBMP
|
||||
|
||||
U0 end;
|
||||
|
||||
CBGR24 palette[NUM_BMP_COLORS];
|
||||
CBGR24 palette[BMP_COLORS_NUM];
|
||||
};
|
||||
|
||||
public CFileBMP *BMP4To(CDC *dc)
|
||||
{//To Windows 4-bit BMP.
|
||||
U8 *src,*ptr;
|
||||
CBGR48 palette[NUM_COLORS];
|
||||
CBGR48 palette[COLORS_NUM];
|
||||
I64 i,x,y,w=dc->width>>1,
|
||||
size=sizeof(CFileBMP)+dc->width*dc->height>>1;
|
||||
CFileBMP *bmp =CAlloc(size);
|
||||
@@ -43,8 +43,8 @@ public CFileBMP *BMP4To(CDC *dc)
|
||||
bmp->bit_cnt =4;
|
||||
bmp->image_size =dc->width*dc->height>>1;
|
||||
GrPaletteGet(palette);
|
||||
#assert NUM_COLORS==NUM_BMP_COLORS
|
||||
for (i=0;i<NUM_BMP_COLORS;i++) {
|
||||
#assert COLORS_NUM==BMP_COLORS_NUM
|
||||
for (i=0;i<BMP_COLORS_NUM;i++) {
|
||||
bmp->palette[i].b=palette[i].b>>8;
|
||||
bmp->palette[i].g=palette[i].g>>8;
|
||||
bmp->palette[i].r=palette[i].r>>8;
|
||||
@@ -66,7 +66,7 @@ public CFileBMP *BMPRLE4To(CDC *dc)
|
||||
{//To Windows RLE4 bit BMP.
|
||||
U8 *src,*ptr,*start;
|
||||
I64 i,x,y,w=dc->width,cnt,pattern;
|
||||
CBGR48 palette[NUM_COLORS];
|
||||
CBGR48 palette[COLORS_NUM];
|
||||
CFileBMP *bmp =CAlloc(sizeof(CFileBMP)+2*(dc->width+1)*dc->height);
|
||||
bmp->type ='BM';
|
||||
bmp->planes =1;
|
||||
@@ -77,8 +77,8 @@ public CFileBMP *BMPRLE4To(CDC *dc)
|
||||
bmp->bit_cnt =4;
|
||||
bmp->compression=2; //RLE4
|
||||
GrPaletteGet(palette);
|
||||
#assert NUM_COLORS==NUM_BMP_COLORS
|
||||
for (i=0;i<NUM_BMP_COLORS;i++) {
|
||||
#assert COLORS_NUM==BMP_COLORS_NUM
|
||||
for (i=0;i<BMP_COLORS_NUM;i++) {
|
||||
bmp->palette[i].b=palette[i].b>>8;
|
||||
bmp->palette[i].g=palette[i].g>>8;
|
||||
bmp->palette[i].r=palette[i].r>>8;
|
||||
@@ -94,7 +94,7 @@ public CFileBMP *BMPRLE4To(CDC *dc)
|
||||
src+=2;
|
||||
cnt=2;
|
||||
x+=2;
|
||||
while (x<w && cnt<MAX_U8) {
|
||||
while (x<w && cnt<U8_MAX) {
|
||||
if (*src&15==pattern&15) {
|
||||
src++;
|
||||
cnt++;
|
||||
@@ -184,14 +184,14 @@ public I64 BMPWrite(U8 *filename,CDC *dc,I64 bits=4)
|
||||
U8 *BMPPaletteNew(CFileBMP *bmp)
|
||||
{
|
||||
I64 i,j,best,score,best_score;
|
||||
CBGR48 palette[NUM_COLORS];
|
||||
U8 *res=CAlloc(NUM_BMP_COLORS*sizeof(U8));
|
||||
CBGR48 palette[COLORS_NUM];
|
||||
U8 *res=CAlloc(BMP_COLORS_NUM*sizeof(U8));
|
||||
GrPaletteGet(palette);
|
||||
#assert NUM_COLORS==NUM_BMP_COLORS
|
||||
for (i=0;i<NUM_BMP_COLORS;i++) {
|
||||
#assert COLORS_NUM==BMP_COLORS_NUM
|
||||
for (i=0;i<BMP_COLORS_NUM;i++) {
|
||||
best=i;
|
||||
best_score=MAX_I64;
|
||||
for (j=0;j<NUM_BMP_COLORS;j++) {
|
||||
best_score=I64_MAX;
|
||||
for (j=0;j<BMP_COLORS_NUM;j++) {
|
||||
score=SqrI64(bmp->palette[i].r-palette[j].r>>8)+
|
||||
SqrI64(bmp->palette[i].g-palette[j].g>>8)+
|
||||
SqrI64(bmp->palette[i].b-palette[j].b>>8);
|
||||
@@ -205,7 +205,7 @@ U8 *BMPPaletteNew(CFileBMP *bmp)
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 ms_paint_palette[NUM_BMP_COLORS]={0,4,2,6,1,5,3,8,7,12,10,14,9,13,11,15};
|
||||
U8 ms_paint_palette[BMP_COLORS_NUM]={0,4,2,6,1,5,3,8,7,12,10,14,9,13,11,15};
|
||||
|
||||
I64 BMP24Color(CBGR24 *ptr,Bool dither_probability)
|
||||
{
|
||||
@@ -245,7 +245,7 @@ public CDC *BMPRead(U8 *filename,Bool dither_probability=FALSE,
|
||||
CDC *res=NULL;
|
||||
if (ptr=FileRead(filename)) {
|
||||
bmp=ptr;
|
||||
if (0<bmp->width<MAX_I32 && 0<bmp->height<MAX_I32) {
|
||||
if (0<bmp->width<I32_MAX && 0<bmp->height<I32_MAX) {
|
||||
res=DCNew(bmp->width,bmp->height);
|
||||
ptr+=bmp->data_offset;
|
||||
if (bmp->compression==2)
|
||||
|
||||
@@ -48,13 +48,32 @@ public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||
{//Check documents for broken file links.
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
U8 *st;
|
||||
progress2_max=1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$+f+F+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
|
||||
st=MStrPrint("Before %s Broke:%d",tmpde->full_name,res);
|
||||
if (StrLen(st)>PROGRESS_DESC_LEN-1)
|
||||
st[PROGRESS_DESC_LEN-1]=0;
|
||||
StrCpy(progress2_desc,st);
|
||||
Free(st);
|
||||
Yield;
|
||||
|
||||
res+=LinkChkFile(tmpde->full_name,&fuf_flags);
|
||||
|
||||
st=MStrPrint("After %s Broke:%d",tmpde->full_name,res);
|
||||
if (StrLen(st)>PROGRESS_DESC_LEN-1)
|
||||
st[PROGRESS_DESC_LEN-1]=0;
|
||||
StrCpy(progress2_desc,st);
|
||||
Free(st);
|
||||
Yield;
|
||||
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tmpde1);
|
||||
progress2_max=0;
|
||||
return res;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ I64 TSSSize(CTSS *tss)
|
||||
I64 PenBrushesSize()
|
||||
{
|
||||
I64 res=0,i;
|
||||
for (i=0;i<GR_NUM_PEN_BRUSHES;i++)
|
||||
for (i=0;i<GR_PEN_BRUSHES_NUM;i++)
|
||||
res+=DCSize(gr.pen_brushes[i])+DCSize(gr.collision_pen_brushes[i])+
|
||||
DCSize(gr.even_pen_brushes[i])+DCSize(gr.odd_pen_brushes[i]);
|
||||
return res;
|
||||
@@ -17,7 +17,7 @@ I64 PenBrushesSize()
|
||||
I64 ScrnZoomTablesSize()
|
||||
{
|
||||
I64 res=0,i;
|
||||
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++)
|
||||
for (i=1;i<=GR_SCRN_ZOOM_MAX;i++)
|
||||
res+=MSize2(gr.scrn_zoom_tables[i]);
|
||||
return res;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ I64 BlkDevsSize()
|
||||
{
|
||||
I64 i,j,res=MSize2(blkdev.blkdevs);
|
||||
CBlkDev *bd;
|
||||
for (i=0;i<NUM_BLKDEVS;i++) {
|
||||
for (i=0;i<BLKDEVS_NUM;i++) {
|
||||
bd=&blkdev.blkdevs[i];
|
||||
if (bd->bd_signature==BD_SIGNATURE_VAL) {
|
||||
j=(bd->max_blk+1)<<BLK_SIZE_BITS;
|
||||
@@ -81,7 +81,7 @@ I64 BlkDevsSize()
|
||||
I64 DrvsSize()
|
||||
{
|
||||
I64 i,res=MSize2(blkdev.drvs);
|
||||
for (i=0;i<NUM_DRVS;i++)
|
||||
for (i=0;i<DRVS_NUM;i++)
|
||||
res+=MSize2(blkdev.drvs[i].cur_fat_blk)+MSize2(blkdev.drvs[i].fis);
|
||||
return res;
|
||||
}
|
||||
|
||||
+56
-23
@@ -1,6 +1,6 @@
|
||||
#help_index "Misc/TOS"
|
||||
|
||||
public U0 TOSStaffIns()
|
||||
U0 TOSStaffIns()
|
||||
{//Completes TOS install from TempleOSStaff.ISO
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
@@ -9,16 +9,32 @@ public U0 TOSStaffIns()
|
||||
DocClear;
|
||||
"$$PURPLE$$$$TX+CX,\"Complete TOS install from TempleOSStaff.ISO\"$$$$FG$$\n\n\n\n";
|
||||
InsRereg;
|
||||
if (HostChgDsk("/home/tad/TAD/Site1/Wb/TempleOSSup1.ISO.C"))
|
||||
CopyTree("T:/","~/Sup1");
|
||||
if (HostChgDsk("/home/tad/TAD/Site1Stale/files/TempleOSBooks1.ISO.C"))
|
||||
CopyTree("T:/","~/Books1");
|
||||
if (HostChgDsk("/home/tad/TAD/Site1Stale/files/TempleOSBooks2.ISO.C"))
|
||||
CopyTree("T:/","~/Books2");
|
||||
|
||||
"\nDownload TempleOSSup1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
|
||||
"Download TempleOSBooks1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
|
||||
"Download TempleOSBooks2.ISO.C\tfrom http://www.templeos.org AppStore.\n\n";
|
||||
|
||||
if (PressAKey!=CH_SHIFT_ESC) {
|
||||
if (HostChgDsk("/home/tad/TempleOSSup1.ISO.C"))
|
||||
CopyTree("T:/","~/Sup1");
|
||||
if (HostChgDsk("/home/tad/TempleOSBooks1.ISO.C"))
|
||||
CopyTree("T:/","~/Books1");
|
||||
if (HostChgDsk("/home/tad/TempleOSBooks2.ISO.C"))
|
||||
CopyTree("T:/","~/Books2");
|
||||
|
||||
Once("TOSBootHDIns;");
|
||||
"\nDo you wish to run >$FG,2$TOSRegen;$FG$ to generate\n the "
|
||||
"distro ISO's and the website image, $FG,2$D:/Wb$FG$ ";
|
||||
if (YorN) {
|
||||
Once("TOSRegen;");
|
||||
BootRAM("C:/" KERNEL_BIN_C); //Boot so TOSRegen cmd is available.
|
||||
} else {
|
||||
"\nReboot ";
|
||||
if (YorN)
|
||||
Reboot;
|
||||
}
|
||||
}
|
||||
SettingsPop;
|
||||
Once("TOSBootHDIns;\"\n\nRun TOSRegen;\n\n\n\";");
|
||||
if (PressAKey!=CH_SHIFT_ESC)
|
||||
Reboot;
|
||||
}
|
||||
|
||||
public U0 TOSStdIns()
|
||||
@@ -30,18 +46,35 @@ public U0 TOSStdIns()
|
||||
DocClear;
|
||||
"$$PURPLE$$$$TX+CX,\"Complete TOS install from TempleOSCD.ISO\"$$$$FG$$\n\n\n\n";
|
||||
InsRereg;
|
||||
if (FileFind("/Demo/AcctExample"))
|
||||
Copy("::/Demo/AcctExample/*","~");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSSup1.ISO.C"))
|
||||
CopyTree("T:/","~/Sup1");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSWeb.ISO.C"))
|
||||
CopyTree("T:/","~/Web");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks1.ISO.C"))
|
||||
CopyTree("T:/","~/Books1");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks2.ISO.C"))
|
||||
CopyTree("T:/","~/Books2");
|
||||
|
||||
"\nDownload TempleOSSup1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
|
||||
"Download TempleOSWeb.ISO.C\tfrom http://www.templeos.org AppStore.\n"
|
||||
"Download TempleOSBooks1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
|
||||
"Download TempleOSBooks2.ISO.C\tfrom http://www.templeos.org AppStore.\n\n";
|
||||
|
||||
if (PressAKey!=CH_SHIFT_ESC) {
|
||||
if (FileFind("/Demo/AcctExample"))
|
||||
CopyTree("::/Demo/AcctExample","~");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSSup1.ISO.C"))
|
||||
CopyTree("T:/","~/Sup1");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSWeb.ISO.C"))
|
||||
CopyTree("T:/","~/Web");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks1.ISO.C"))
|
||||
CopyTree("T:/","~/Books1");
|
||||
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks2.ISO.C"))
|
||||
CopyTree("T:/","~/Books2");
|
||||
|
||||
Once("TOSBootHDIns;");
|
||||
"\nDo you wish to run >$FG,2$TOSRegen;$FG$ to generate\n the "
|
||||
"distro ISO's and the website image, $FG,2$D:/Wb$FG$ ";
|
||||
if (YorN) {
|
||||
Once("TOSRegen;");
|
||||
BootRAM("C:/" KERNEL_BIN_C); //Boot so TOSRegen cmd is available.
|
||||
} else {
|
||||
"\nReboot ";
|
||||
if (YorN)
|
||||
Reboot;
|
||||
}
|
||||
}
|
||||
SettingsPop;
|
||||
Once("TOSBootHDIns;\"\n\nRun TOSRegen;\n\n\n\";");
|
||||
if (PressAKey!=CH_SHIFT_ESC)
|
||||
Reboot;
|
||||
}
|
||||
+6
-6
@@ -13,8 +13,8 @@ class CFileSND
|
||||
};
|
||||
|
||||
//Windows media constraint.
|
||||
//#define MAX_SND_FILE_DATA 0x0007FF00
|
||||
#define MAX_SND_FILE_DATA 0x7FFFFF00
|
||||
//#define SND_FILE_DATA_MAX 0x0007FF00
|
||||
#define SND_FILE_DATA_MAX 0x7FFFFF00
|
||||
|
||||
public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
F64 averaging=0.0,I64 waveform=WF_SQUARE,
|
||||
@@ -96,7 +96,7 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
level+=s->body[i];
|
||||
level/=cnt-1;
|
||||
for (i=0;i<cnt-1;i++)
|
||||
s->body[i]=ClampI64(s->body[i]-level,MIN_I16,MAX_I16);
|
||||
s->body[i]=ClampI64(s->body[i]-level,I16_MIN,I16_MAX);
|
||||
}
|
||||
|
||||
for (i=0;i<cnt-1;i++)
|
||||
@@ -117,10 +117,10 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
file_num=0;
|
||||
while (cnt2>0) {
|
||||
i=cnt2;
|
||||
if (i>MAX_SND_FILE_DATA)
|
||||
i=MAX_SND_FILE_DATA;
|
||||
if (i>SND_FILE_DATA_MAX)
|
||||
i=SND_FILE_DATA_MAX;
|
||||
s->data_size=EndianU32(i*sizeof(I16));
|
||||
MemCpy(s->body,&s->body[file_num*MAX_SND_FILE_DATA],i*sizeof(I16));
|
||||
MemCpy(s->body,&s->body[file_num*SND_FILE_DATA_MAX],i*sizeof(I16));
|
||||
StrPrint(name2,"%s%03d.SND",name,file_num++);
|
||||
FileWrite(name2,s,offset(CFileSND.body)+i*sizeof(I16));
|
||||
cnt2-=i;
|
||||
|
||||
+4
-4
@@ -138,7 +138,7 @@ public U0 SndWaveCtrlDel(CSndWaveCtrl *swc)
|
||||
#define WF_TRI 3
|
||||
#define WF_SAWTOOTH 4
|
||||
#define WF_NOISE 5
|
||||
#define WF_NUM_WAVEFORMS 6
|
||||
#define WF_WAVEFORMS_NUM 6
|
||||
|
||||
public U0 SndWaveAddBuf(CSndWaveCtrl *swc,U8 *buf,I64 num_samples,
|
||||
F64 _freq,I64 _waveform=WF_SQUARE,F64 _amp=1.0,F64 _left=1.0, F64 _right=1.0)
|
||||
@@ -157,7 +157,7 @@ public U0 SndWaveAddBuf(CSndWaveCtrl *swc,U8 *buf,I64 num_samples,
|
||||
} else {
|
||||
phase=swc->phase;
|
||||
i=0;
|
||||
amp=Min(MAX_I32,MAX_I32*_amp);
|
||||
amp=Min(I32_MAX,I32_MAX*_amp);
|
||||
f=2*ã/swc->sample_rate*_freq;
|
||||
switch (_waveform) {
|
||||
case WF_NOISE:
|
||||
@@ -201,13 +201,13 @@ public U0 SndWaveAddBuf(CSndWaveCtrl *swc,U8 *buf,I64 num_samples,
|
||||
if (phase<ã) {
|
||||
if (phase<f) {
|
||||
swc->last_y=swc->next_y;
|
||||
swc->next_y=a*RandI16/MAX_U16;
|
||||
swc->next_y=a*RandI16/U16_MAX;
|
||||
}
|
||||
j=swc->last_y*(ã-phase)+swc->next_y*phase;
|
||||
} else {
|
||||
if (phase-ã<f) {
|
||||
swc->last_y=swc->next_y;
|
||||
swc->next_y=a*RandI16/MAX_U16;
|
||||
swc->next_y=a*RandI16/U16_MAX;
|
||||
}
|
||||
j=swc->last_y*(2.0*ã-phase)+swc->next_y*(phase-ã);
|
||||
}
|
||||
|
||||
Binary file not shown.
+9
-6
@@ -30,12 +30,12 @@ U0 DrawProgressBars(CDC *dc)
|
||||
{
|
||||
I64 i,j,k,n,m;
|
||||
U8 *st,*st2;
|
||||
for (i=0;i<NUM_PROGRESS_BARS;i++) {
|
||||
for (i=0;i<PROGRESS_BARS_NUM;i++) {
|
||||
if (m=sys_progresses[i].max) {
|
||||
dc->color=BLACK;
|
||||
GrRect(dc,
|
||||
(GR_WIDTH-PROGRESS_BAR_WIDTH)/2,
|
||||
(GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2,
|
||||
(GR_HEIGHT-(PROGRESS_BARS_NUM*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2,
|
||||
PROGRESS_BAR_WIDTH,PROGRESS_BAR_HEIGHT);
|
||||
|
||||
dc->color=LTGREEN;
|
||||
@@ -44,7 +44,7 @@ U0 DrawProgressBars(CDC *dc)
|
||||
n=m;
|
||||
GrRect(dc,
|
||||
(GR_WIDTH-PROGRESS_BAR_WIDTH)/2+2,
|
||||
(GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2+2,
|
||||
(GR_HEIGHT-(PROGRESS_BARS_NUM*2-1-i*4)*PROGRESS_BAR_HEIGHT)/2+2,
|
||||
n*(PROGRESS_BAR_WIDTH-4)/m,
|
||||
PROGRESS_BAR_HEIGHT-4);
|
||||
|
||||
@@ -56,11 +56,11 @@ U0 DrawProgressBars(CDC *dc)
|
||||
GrLine(dc,
|
||||
(GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j*
|
||||
(PROGRESS_BAR_WIDTH-4)/ToF64(k+1),
|
||||
(GR_HEIGHT-(NUM_PROGRESS_BARS*2-1-i*4)*
|
||||
(GR_HEIGHT-(PROGRESS_BARS_NUM*2-1-i*4)*
|
||||
PROGRESS_BAR_HEIGHT)/2+4,
|
||||
(GR_WIDTH-PROGRESS_BAR_WIDTH)/2+1+j*
|
||||
(PROGRESS_BAR_WIDTH-4)/ToF64(k+1),
|
||||
(GR_HEIGHT-(NUM_PROGRESS_BARS*2-3-i*4)*
|
||||
(GR_HEIGHT-(PROGRESS_BARS_NUM*2-3-i*4)*
|
||||
PROGRESS_BAR_HEIGHT)/2-4);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ U0 DrawProgressBars(CDC *dc)
|
||||
} else
|
||||
st=st2;
|
||||
GrPrint(dc,(GR_WIDTH-FONT_WIDTH*StrLen(st))/2,(GR_HEIGHT-FONT_HEIGHT-
|
||||
(NUM_PROGRESS_BARS*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st);
|
||||
(PROGRESS_BARS_NUM*2-2-i*4)*PROGRESS_BAR_HEIGHT)/2,"%s",st);
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
@@ -203,6 +203,9 @@ U0 WinFinalUpdate(CDC *dc)
|
||||
{
|
||||
if (ms_grid.show)
|
||||
DrawWinGrid(dc);
|
||||
if (ms_grid.coord)
|
||||
GrPrint(dc,GR_WIDTH-FONT_WIDTH*10,FONT_HEIGHT*3,
|
||||
"(%03d,%03d)",ms.pos.x,ms.pos.y);
|
||||
DrawProgressBars(dc);
|
||||
if (winmgr.show_menu)
|
||||
DrawMenu(dc);
|
||||
|
||||
+1
-1
@@ -193,7 +193,7 @@ I64 WinQueIPMsgs(Bool que)
|
||||
U0 WinCalcIdles()
|
||||
{
|
||||
F64 calc_idle_time;
|
||||
I64 i,k,total_jiffies,total_jiffies_delta,idle_pt_hits[MP_MAX_PROCESSORS];
|
||||
I64 i,k,total_jiffies,total_jiffies_delta,idle_pt_hits[MP_PROCESSORS_NUM];
|
||||
CCPU *c;
|
||||
CWinMgrTimingGlbls *t=winmgr.t;
|
||||
|
||||
|
||||
Reference in new issue
Block a user