TempleOSCDV4.08.ISO
This commit is contained in:
1 parent
b632ab9a4f
commit
2d56cda5f3
258 files changed
+6845
-5348
No files matched your search
Binary file not shown.
@@ -109,7 +109,7 @@ I64 CopyTree2(CDirEntry *tempde,I64 src_dir_len,I64 dst_dir_len,U8 *dst_dir)
|
|||||||
MemCpy(st,dst_dir,dst_dir_len);
|
MemCpy(st,dst_dir,dst_dir_len);
|
||||||
StrCpy(st+dst_dir_len,tempde->full_name+src_dir_len);
|
StrCpy(st+dst_dir_len,tempde->full_name+src_dir_len);
|
||||||
if (tempde->attr & RS_ATTR_DIR) {
|
if (tempde->attr & RS_ATTR_DIR) {
|
||||||
MkDir(st);
|
MkDir(st,LinkedLstCnt(tempde->sub));
|
||||||
res+=CopyTree2(tempde->sub,src_dir_len,dst_dir_len,dst_dir);
|
res+=CopyTree2(tempde->sub,src_dir_len,dst_dir_len,dst_dir);
|
||||||
} else
|
} else
|
||||||
if (CopySingle(tempde->full_name,st))
|
if (CopySingle(tempde->full_name,st))
|
||||||
|
|||||||
+12
-13
@@ -55,7 +55,7 @@ I64 RedSeaChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
|||||||
|
|
||||||
Drv(drv_let);
|
Drv(drv_let);
|
||||||
"Scanning...\n";
|
"Scanning...\n";
|
||||||
size=(dv->size-(dv->data_area-dv->base_offset))/dv->spc;
|
size=(dv->size-(dv->data_area-dv->drv_offset))/dv->spc;
|
||||||
bpc=dv->spc<<BLK_SIZE_BITS;
|
bpc=dv->spc<<BLK_SIZE_BITS;
|
||||||
bits=CAlloc((size+7)>>3);
|
bits=CAlloc((size+7)>>3);
|
||||||
bits2=CAlloc((size+7)>>3+BLK_SIZE);
|
bits2=CAlloc((size+7)>>3+BLK_SIZE);
|
||||||
@@ -159,7 +159,7 @@ I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
|||||||
U32 *bits2;
|
U32 *bits2;
|
||||||
Drv(drv_let);
|
Drv(drv_let);
|
||||||
"Scanning...\n";
|
"Scanning...\n";
|
||||||
size=(dv->size-(dv->data_area-dv->base_offset))/dv->spc;
|
size=(dv->size-(dv->data_area-dv->drv_offset))/dv->spc;
|
||||||
bpc=dv->spc<<BLK_SIZE_BITS;
|
bpc=dv->spc<<BLK_SIZE_BITS;
|
||||||
bits=CAlloc((size+7)>>3);
|
bits=CAlloc((size+7)>>3);
|
||||||
bits2=CAlloc(size*4+BLK_SIZE);
|
bits2=CAlloc(size*4+BLK_SIZE);
|
||||||
@@ -232,15 +232,14 @@ public I64 ChkDsk(U8 drv_let=0,Bool fix=FALSE,Bool confirm=TRUE)
|
|||||||
U0 RedSeaDrvView(U8 drv_let=0)
|
U0 RedSeaDrvView(U8 drv_let=0)
|
||||||
{
|
{
|
||||||
CDrv *dv=Let2Drv(drv_let);
|
CDrv *dv=Let2Drv(drv_let);
|
||||||
I64 lohi,c1,i,x,y,l,s;
|
I64 lohi,c1,i,x,y,l=(GR_HEIGHT-3*FONT_HEIGHT)*(GR_WIDTH-FONT_WIDTH<<1),
|
||||||
|
s=dv->size+dv->drv_offset-dv->data_area;
|
||||||
U8 *bitmap;
|
U8 *bitmap;
|
||||||
CDC *dc=DCAlias;
|
CDC *dc=DCAlias;
|
||||||
|
|
||||||
l=(GR_HEIGHT-3*FONT_HEIGHT)*(GR_WIDTH-FONT_WIDTH<<1),
|
|
||||||
s=(dv->size+dv->spc-1)/dv->spc;
|
|
||||||
|
|
||||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||||
WinMax;
|
WinMax;
|
||||||
|
WinBorder(ON);
|
||||||
DocCursor;
|
DocCursor;
|
||||||
DocClear;
|
DocClear;
|
||||||
DCFill;
|
DCFill;
|
||||||
@@ -275,14 +274,14 @@ U0 RedSeaDrvView(U8 drv_let=0)
|
|||||||
U0 FAT32DrvView(U8 drv_let=0)
|
U0 FAT32DrvView(U8 drv_let=0)
|
||||||
{
|
{
|
||||||
CDrv *dv=Let2Drv(drv_let);
|
CDrv *dv=Let2Drv(drv_let);
|
||||||
I64 lohi,c1,i,x,y,l,s;
|
I64 lohi,c1,i,x,y,l=(GR_HEIGHT-3*FONT_HEIGHT)*(GR_WIDTH-FONT_WIDTH<<1),
|
||||||
|
s=(dv->size+dv->spc-1)/dv->spc-(2+dv->data_area-dv->drv_offset);
|
||||||
U32 *bitmap;
|
U32 *bitmap;
|
||||||
CDC *dc=DCAlias;
|
CDC *dc=DCAlias;
|
||||||
l=(GR_HEIGHT-3*FONT_HEIGHT)*(GR_WIDTH-FONT_WIDTH<<1),
|
|
||||||
s=(dv->size+dv->spc-1)/dv->spc;
|
|
||||||
|
|
||||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||||
WinMax;
|
WinMax;
|
||||||
|
WinBorder(ON);
|
||||||
DocCursor;
|
DocCursor;
|
||||||
DocClear;
|
DocClear;
|
||||||
DCFill;
|
DCFill;
|
||||||
@@ -357,8 +356,8 @@ public U0 DskView(U8 drv_let=0)
|
|||||||
for (i=0;i<NUM_DRVS;i++) {
|
for (i=0;i<NUM_DRVS;i++) {
|
||||||
dv=&blkdev.drvs[i];
|
dv=&blkdev.drvs[i];
|
||||||
if (bd==dv->bd && dv->fs_type) {
|
if (bd==dv->bd && dv->fs_type) {
|
||||||
sect_start=-(dv->base_offset*2*ã/(bd->max_blk+1));
|
sect_start=-(dv->drv_offset*2*ã/(bd->max_blk+1));
|
||||||
sect_end =-((dv->base_offset+dv->size)*2*ã/(bd->max_blk+1));
|
sect_end =-((dv->drv_offset+dv->size)*2*ã/(bd->max_blk+1));
|
||||||
dc->color=BLACK;
|
dc->color=BLACK;
|
||||||
GrLine(dc,h>>1,v>>1,
|
GrLine(dc,h>>1,v>>1,
|
||||||
h>>1+radius*Cos(sect_start),
|
h>>1+radius*Cos(sect_start),
|
||||||
@@ -392,7 +391,7 @@ I64 RedSeaUnusedDrvSpace(U8 drv_let=0)
|
|||||||
I64 res=0,i,l;
|
I64 res=0,i,l;
|
||||||
U8 *bitmap;
|
U8 *bitmap;
|
||||||
try {
|
try {
|
||||||
l=(dv->size+dv->spc-1)/dv->spc;
|
l=dv->size+dv->drv_offset-dv->data_area;
|
||||||
i=((l+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
i=((l+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||||
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
||||||
RBlks(dv,bitmap,dv->fat1,i);
|
RBlks(dv,bitmap,dv->fat1,i);
|
||||||
@@ -410,7 +409,7 @@ I64 FAT32UnusedDrvSpace(U8 drv_let=0)
|
|||||||
I64 res=0,i,l;
|
I64 res=0,i,l;
|
||||||
U32 *bitmap;
|
U32 *bitmap;
|
||||||
try {
|
try {
|
||||||
l=(dv->size+dv->spc-1)/dv->spc;
|
l=(dv->size+dv->spc-1)/dv->spc-(2+dv->data_area-dv->drv_offset);
|
||||||
i=(l*4+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
i=(l*4+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||||
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
||||||
RBlks(dv,bitmap,dv->fat1,i);
|
RBlks(dv,bitmap,dv->fat1,i);
|
||||||
|
|||||||
@@ -217,17 +217,15 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_root,I64 mode)
|
|||||||
DocPrint(doc,"$$LTBLUE$$");
|
DocPrint(doc,"$$LTBLUE$$");
|
||||||
for (i=0;i<NUM_DRVS;i++) {
|
for (i=0;i<NUM_DRVS;i++) {
|
||||||
dv=&blkdev.drvs[i];
|
dv=&blkdev.drvs[i];
|
||||||
if (dv->fs_type==FSt_REDSEA||dv->fs_type==FSt_FAT32)
|
if (dv->bd->type==BDT_ATAPI) {
|
||||||
FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
|
|
||||||
else if (dv->fs_type==FSt_ISO9660) {
|
|
||||||
if (dv->bd->flags&BDF_INITIALIZED)
|
if (dv->bd->flags&BDF_INITIALIZED)
|
||||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
|
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
|
||||||
else {
|
else {
|
||||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,FALSE);
|
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,FALSE);
|
||||||
tempde->flags|=DEF_NOT_INITIALIZED;
|
tempde->flags|=DEF_NOT_INITIALIZED;
|
||||||
}
|
}
|
||||||
tempde->flags|=DEF_REMOVABLE;
|
} else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32)
|
||||||
}
|
FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
|
||||||
}
|
}
|
||||||
DocTop(doc);
|
DocTop(doc);
|
||||||
FMMarkUncollapsed(doc,tempc,cur_entry,next_entry);
|
FMMarkUncollapsed(doc,tempc,cur_entry,next_entry);
|
||||||
@@ -382,7 +380,7 @@ U0 FMMakeISO(CDoc *doc)
|
|||||||
st=MStrPrint("%s*",tempde->full_name);
|
st=MStrPrint("%s*",tempde->full_name);
|
||||||
else
|
else
|
||||||
st=MStrPrint("%s/*",tempde->full_name);
|
st=MStrPrint("%s/*",tempde->full_name);
|
||||||
ISOFileCreate(,st);
|
ISO9660ISO(,st);
|
||||||
Free(st);
|
Free(st);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
@@ -566,8 +564,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
|||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
do msg_code=GetMsg(&a1,&a2,
|
do msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|1<<MSG_IP_L_UP|
|
||||||
1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|1<<MSG_IP_L_UP|
|
|
||||||
1<<MSG_IP_R_UP);
|
1<<MSG_IP_R_UP);
|
||||||
while (Fs!=sys_focus_task);
|
while (Fs!=sys_focus_task);
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
@@ -655,7 +652,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
|||||||
FMRightClick;
|
FMRightClick;
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
break;
|
break;
|
||||||
sub_switch_start:
|
start:
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
case CH_CTRLV:
|
case CH_CTRLV:
|
||||||
FMCopy(doc);
|
FMCopy(doc);
|
||||||
@@ -681,7 +678,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
|||||||
case 'f':
|
case 'f':
|
||||||
FMFmtDrv(doc);
|
FMFmtDrv(doc);
|
||||||
break;
|
break;
|
||||||
sub_switch_end:
|
end:
|
||||||
FMRebuildDoc(&doc,&root,mode);
|
FMRebuildDoc(&doc,&root,mode);
|
||||||
break;
|
break;
|
||||||
case CH_SHIFT_ESC:
|
case CH_SHIFT_ESC:
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
|
|||||||
DrvRep;
|
DrvRep;
|
||||||
"\n****** Mount Drives ******\n"
|
"\n****** Mount Drives ******\n"
|
||||||
"$$GREEN$$A$$FG$$-$$GREEN$$B$$FG$$ are RAM drives.\n"
|
"$$GREEN$$A$$FG$$-$$GREEN$$B$$FG$$ are RAM drives.\n"
|
||||||
"$$GREEN$$C$$FG$$-$$GREEN$$S$$FG$$ are ATA hard drives.\n"
|
"$$GREEN$$C$$FG$$-$$GREEN$$L$$FG$$ are ATA hard drives.\n"
|
||||||
|
"$$GREEN$$M$$FG$$-$$GREEN$$S$$FG$$ are file drives.\n"
|
||||||
"$$GREEN$$T$$FG$$-$$GREEN$$Z$$FG$$ are ATAPI CD/DVD drives.\n"
|
"$$GREEN$$T$$FG$$-$$GREEN$$Z$$FG$$ are ATAPI CD/DVD drives.\n"
|
||||||
"\nDrive Letter ($$PURPLE$$<ENTER>$$FG$$ to exit):";
|
"\nDrive Letter ($$PURPLE$$<ENTER>$$FG$$ to exit):";
|
||||||
drv_let=ToUpper(GetChar);
|
drv_let=ToUpper(GetChar);
|
||||||
@@ -31,9 +32,9 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
|
|||||||
unit=0;
|
unit=0;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BDT_RAM:
|
case BDT_RAM:
|
||||||
type=BDT_RAM;
|
|
||||||
"Addr of RAM disk ($$PURPLE$$<ENTER>$$FG$$ to MAlloc):";
|
"Addr of RAM disk ($$PURPLE$$<ENTER>$$FG$$ to MAlloc):";
|
||||||
GetS(addr_buf,STR_LEN);
|
GetS(addr_buf,STR_LEN);
|
||||||
|
case BDT_FILE:
|
||||||
"Blks of 512 bytes:";
|
"Blks of 512 bytes:";
|
||||||
GetS(blks_buf,STR_LEN);
|
GetS(blks_buf,STR_LEN);
|
||||||
break;
|
break;
|
||||||
@@ -77,8 +78,10 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case BDT_RAM:
|
case BDT_RAM:
|
||||||
if (!*addr_buf) StrCpy(addr_buf,"0");
|
if (!*addr_buf) StrCpy(addr_buf,"0");
|
||||||
DocPrint(doc,"bd->RAM_dsk=%s;bd->max_blk=(%s)-1;\n",
|
DocPrint(doc,"bd->RAM_dsk=%s;\n",addr_buf);
|
||||||
addr_buf,blks_buf);
|
case BDT_FILE:
|
||||||
|
if (!*blks_buf) StrCpy(blks_buf,"0");
|
||||||
|
DocPrint(doc,"bd->max_blk=(%s)-1;\n",blks_buf);
|
||||||
break;
|
break;
|
||||||
case BDT_ATA:
|
case BDT_ATA:
|
||||||
case BDT_ATAPI:
|
case BDT_ATAPI:
|
||||||
|
|||||||
+2
-2
@@ -11,8 +11,8 @@ U0 LoadDocDefines()
|
|||||||
//This is cut and replaced when I generate a distro.
|
//This is cut and replaced when I generate a distro.
|
||||||
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
|
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
|
||||||
$TR-C,"LineRep"$
|
$TR-C,"LineRep"$
|
||||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,714");
|
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,845");
|
||||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","79,854");
|
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,741");
|
||||||
$ID,-4$
|
$ID,-4$
|
||||||
DefinePrint("DD_KERNEL","%08X",bfh);
|
DefinePrint("DD_KERNEL","%08X",bfh);
|
||||||
bfh(I64)+=bfh->file_size-1;
|
bfh(I64)+=bfh->file_size-1;
|
||||||
|
|||||||
+3
-2
@@ -48,11 +48,11 @@ extern U0 DrawCtrls(CTask *task);
|
|||||||
extern Bool Ed(U8 *link_st,I64 edf_dof_flags=0);
|
extern Bool Ed(U8 *link_st,I64 edf_dof_flags=0);
|
||||||
extern U0 EdCodeTools(CDoc *doc);
|
extern U0 EdCodeTools(CDoc *doc);
|
||||||
extern U8 *EdSprite(I64 bin_num);
|
extern U8 *EdSprite(I64 bin_num);
|
||||||
extern I64 ExeDoc(CDoc *doc,Bool just_load=FALSE);
|
extern I64 ExeDoc(CDoc *doc,I64 ccf_flags=0);
|
||||||
extern I64 FindWiz();
|
extern I64 FindWiz();
|
||||||
extern I64 GetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64);
|
extern I64 GetI64(U8 *msg,I64 dft,I64 lo=MIN_I64,I64 hi=MAX_I64);
|
||||||
extern U0 GrPlot0(CDC *dc,I64 x,I64 y);
|
extern U0 GrPlot0(CDC *dc,I64 x,I64 y);
|
||||||
extern I64 ISOFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,
|
extern I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||||
U8 *fu_flags=NULL,U8 *_stage2_filename=NULL);
|
U8 *fu_flags=NULL,U8 *_stage2_filename=NULL);
|
||||||
extern CMenuEntry *MenuEntryFind(CMenu *m,U8 *full_name);
|
extern CMenuEntry *MenuEntryFind(CMenu *m,U8 *full_name);
|
||||||
extern CMenu *MenuFilePush(U8 *filename);
|
extern CMenu *MenuFilePush(U8 *filename);
|
||||||
@@ -70,6 +70,7 @@ extern I64 PopUpFile(U8 *filename,
|
|||||||
Bool warn_ext=TRUE,CTask *parent=NULL,CTask **_pu_task=NULL);
|
Bool warn_ext=TRUE,CTask *parent=NULL,CTask **_pu_task=NULL);
|
||||||
extern Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,
|
extern Bool PopUpForm(U8 *_d,U8 *class_name=lastclass,
|
||||||
I64 dof_flags=DOF_MIN_SIZE,U8 *header=NULL,U8 *footer=NULL);
|
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);
|
||||||
extern U8 *PopUpGetStr(U8 *header=NULL);
|
extern U8 *PopUpGetStr(U8 *header=NULL);
|
||||||
extern I64 PopUpMenu(CDoc *doc,I64 dof_flags=0);
|
extern I64 PopUpMenu(CDoc *doc,I64 dof_flags=0);
|
||||||
extern Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL);
|
extern Bool PopUpNoYes(U8 *header=NULL,U8 *footer=NULL);
|
||||||
|
|||||||
+5
-3
@@ -398,11 +398,13 @@ public U0 MapFileLoad(U8 *filename)
|
|||||||
if (*doc_e->tag) {
|
if (*doc_e->tag) {
|
||||||
Free(temph->src_link);
|
Free(temph->src_link);
|
||||||
temph->src_link=doc_e->aux_str;
|
temph->src_link=doc_e->aux_str;
|
||||||
|
|
||||||
ptr=temph->src_link;
|
ptr=temph->src_link;
|
||||||
if (ptr[0] && ptr[1] && ptr[2]==':' && ptr[3]==':')
|
if (ptr[0] && ptr[1] && ptr[2]==':') {
|
||||||
|
if (ptr[3]==':')
|
||||||
ptr[3]=blkdev.boot_drv_let;
|
ptr[3]=blkdev.boot_drv_let;
|
||||||
|
else if (ptr[3]=='~')
|
||||||
|
ptr[3]=*blkdev.home_dir;
|
||||||
|
}
|
||||||
doc_e->aux_str=NULL;
|
doc_e->aux_str=NULL;
|
||||||
}
|
}
|
||||||
if (temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
|
if (temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
#help_index "Misc/Registry"
|
#help_index "Misc/Registry"
|
||||||
#define REGISTRY_FILENAME "::/Home/Registry.CPP.Z"
|
#define REGISTRY_FILENAME "~/Registry.CPP.Z"
|
||||||
CDoc *sys_registry_doc=NULL;
|
CDoc *sys_registry_doc=NULL;
|
||||||
I64 sys_msg_flags[1]={0};
|
I64 sys_msg_flags[1]={0};
|
||||||
F64 registry_version;
|
F64 registry_version;
|
||||||
@@ -30,7 +30,7 @@ public Bool RegSetDftEntry(U8 *path,U8 *val,Bool is_adam_entry=FALSE)
|
|||||||
else
|
else
|
||||||
Adam("%s",val);
|
Adam("%s",val);
|
||||||
}
|
}
|
||||||
if (DrvIsWritable(':'))
|
if (DrvIsWritable(*sys_registry_doc->filename.name))
|
||||||
DocWrite(sys_registry_doc);
|
DocWrite(sys_registry_doc);
|
||||||
res=FALSE;
|
res=FALSE;
|
||||||
} else
|
} else
|
||||||
@@ -58,7 +58,7 @@ public Bool RegWriteBranch(U8 *path,U8 *fmt,...)
|
|||||||
DocCut(sys_registry_doc,tree_branch,end_indent);
|
DocCut(sys_registry_doc,tree_branch,end_indent);
|
||||||
DocTreeMake(sys_registry_doc,path);
|
DocTreeMake(sys_registry_doc,path);
|
||||||
DocPrint(sys_registry_doc,"%s",buf);
|
DocPrint(sys_registry_doc,"%s",buf);
|
||||||
if (DrvIsWritable(':'))
|
if (DrvIsWritable(*sys_registry_doc->filename.name))
|
||||||
DocWrite(sys_registry_doc);
|
DocWrite(sys_registry_doc);
|
||||||
if (unlock_doc)
|
if (unlock_doc)
|
||||||
DocUnlock(sys_registry_doc);
|
DocUnlock(sys_registry_doc);
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ U0 UpdateDerivedCtrlSlider(CCtrl *c)
|
|||||||
|
|
||||||
U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool down)
|
U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool down)
|
||||||
{
|
{
|
||||||
nounusedwarn down;
|
no_warn down;
|
||||||
CSliderState *s=c->state;
|
CSliderState *s=c->state;
|
||||||
");
|
");
|
||||||
|
|
||||||
|
|||||||
+18
-18
@@ -29,7 +29,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
if (sc>=0 && sc&SCF_CTRL) {
|
if (sc>=0 && sc&SCF_CTRL) {
|
||||||
while (doc_ce->last!=doc && (doc_ce->last->y==y ||
|
while (doc_ce->last!=doc && (doc_ce->last->y==y ||
|
||||||
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)))
|
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP)))
|
||||||
doc_ce=doc_ce->last; //TODO: select? recurse?
|
doc_ce=doc_ce->last; //TODO: sel? recurse?
|
||||||
cc=doc_ce->min_col;
|
cc=doc_ce->min_col;
|
||||||
} else {
|
} else {
|
||||||
if (cc>doc_ce->min_col) {
|
if (cc>doc_ce->min_col) {
|
||||||
@@ -51,7 +51,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
cc=doc_ce->min_col;
|
cc=doc_ce->min_col;
|
||||||
}
|
}
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
} else {
|
} else {
|
||||||
cc=doc_ce->min_col;
|
cc=doc_ce->min_col;
|
||||||
while (doc_ce->last!=doc &&
|
while (doc_ce->last!=doc &&
|
||||||
@@ -60,7 +60,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
doc_ce->last->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
doc_ce->last->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
||||||
doc_ce=doc_ce->last;
|
doc_ce=doc_ce->last;
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
}
|
}
|
||||||
if (doc_ce->last!=doc) {
|
if (doc_ce->last!=doc) {
|
||||||
doc_ce=doc_ce->last;
|
doc_ce=doc_ce->last;
|
||||||
@@ -78,7 +78,7 @@ public U0 EdCursorLeft(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
} else
|
} else
|
||||||
cc=doc_ce->max_col;
|
cc=doc_ce->max_col;
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
old_de_flags=doc_ce->de_flags;
|
old_de_flags=doc_ce->de_flags;
|
||||||
old_color=doc_ce->type;
|
old_color=doc_ce->type;
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
|
if (IsEditableText(doc_ce) && cc<doc_ce->max_col) {
|
||||||
dst=doc_ce->tag+cc;
|
dst=doc_ce->tag+cc;
|
||||||
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
doc_ne=DocEntryNewTag(doc,doc_ce,dst);
|
||||||
@@ -141,17 +141,17 @@ public U0 EdCursorRight(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
} else {
|
} else {
|
||||||
if (doc_ce!=doc) {
|
if (doc_ce!=doc) {
|
||||||
if (cc<=doc_ce->min_col && sc>=0)
|
if (cc<=doc_ce->min_col && sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
while (doc_ce!=doc && doc_ce->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) {
|
while (doc_ce!=doc && doc_ce->de_flags&(DOCEF_SKIP|DOCEF_FILTER_SKIP)) {
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
}
|
}
|
||||||
cc=doc_ce->min_col;
|
cc=doc_ce->min_col;
|
||||||
if (doc_ce->type_u8==DOCT_SOFT_NEW_LINE) {
|
if (doc_ce->type_u8==DOCT_SOFT_NEW_LINE) {
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
cc=doc_ce->min_col;
|
cc=doc_ce->min_col;
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
} else if (doc_ce->last!=doc)
|
} else if (doc_ce->last!=doc)
|
||||||
doc_ce=doc_ce->last;
|
doc_ce=doc_ce->last;
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc->cur_entry=doc_ce;
|
doc->cur_entry=doc_ce;
|
||||||
DocFormBwd(doc);
|
DocFormBwd(doc);
|
||||||
doc_ce=doc->cur_entry;
|
doc_ce=doc->cur_entry;
|
||||||
@@ -206,14 +206,14 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
||||||
doc_ce=doc_ce->last;
|
doc_ce=doc_ce->last;
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
}
|
}
|
||||||
y=doc_ce->y;
|
y=doc_ce->y;
|
||||||
doc->y=y;
|
doc->y=y;
|
||||||
while (doc_ce!=doc && (doc_ce->y>=y && doc_ce->x>=x ||
|
while (doc_ce!=doc && (doc_ce->y>=y && doc_ce->x>=x ||
|
||||||
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
doc_ce->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP))) {
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc_ce=doc_ce->last;
|
doc_ce=doc_ce->last;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
else {
|
else {
|
||||||
if (!IsEditableText(doc_ce)) {
|
if (!IsEditableText(doc_ce)) {
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
} else {
|
} else {
|
||||||
if (doc_ce->next->x==x) {
|
if (doc_ce->next->x==x) {
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
@@ -259,9 +259,9 @@ public U0 EdLineUp(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
*dst=0;
|
*dst=0;
|
||||||
if (sc>=0) {
|
if (sc>=0) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
doc_ne->type=doc_ce->type | DOCET_SELECTED;
|
doc_ne->type=doc_ce->type | DOCET_SEL;
|
||||||
else
|
else
|
||||||
doc_ne->type=doc_ce->type & ~DOCET_SELECTED;
|
doc_ne->type=doc_ce->type & ~DOCET_SEL;
|
||||||
}
|
}
|
||||||
doc_ne->x=doc_ce->x+doc->cur_col;
|
doc_ne->x=doc_ce->x+doc->cur_col;
|
||||||
doc_ce->max_col=doc->cur_col;
|
doc_ce->max_col=doc->cur_col;
|
||||||
@@ -305,9 +305,9 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
*dst=0;
|
*dst=0;
|
||||||
if (sc>=0) {
|
if (sc>=0) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
doc_ne->type=doc_ce->type | DOCET_SELECTED;
|
doc_ne->type=doc_ce->type | DOCET_SEL;
|
||||||
else
|
else
|
||||||
doc_ne->type=doc_ce->type & ~DOCET_SELECTED;
|
doc_ne->type=doc_ce->type & ~DOCET_SEL;
|
||||||
}
|
}
|
||||||
doc_ne->x=doc_ce->x+doc->cur_col;
|
doc_ne->x=doc_ce->x+doc->cur_col;
|
||||||
doc_ce->max_col=doc->cur_col;
|
doc_ce->max_col=doc->cur_col;
|
||||||
@@ -345,7 +345,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
doc_ce2->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) ||
|
doc_ce2->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) ||
|
||||||
doc_ce2->x==x && !doc_ce2->max_col &&
|
doc_ce2->x==x && !doc_ce2->max_col &&
|
||||||
Bt(doldoc.type_flags_nontag_invisible,doc_ce2->type_u8)) && sc>=0)
|
Bt(doldoc.type_flags_nontag_invisible,doc_ce2->type_u8)) && sc>=0)
|
||||||
BEqu(&doc_ce2->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce2->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
if (doc_ce2==doc_ce) break;
|
if (doc_ce2==doc_ce) break;
|
||||||
doc_ce2=doc_ce2->next;
|
doc_ce2=doc_ce2->next;
|
||||||
}
|
}
|
||||||
@@ -377,7 +377,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
if (!(doc->flags & DOCF_FORM))
|
if (!(doc->flags & DOCF_FORM))
|
||||||
while (doc_ce!=doc && doc_ce!=doc->cur_entry) {
|
while (doc_ce!=doc && doc_ce!=doc->cur_entry) {
|
||||||
if (sc>=0)
|
if (sc>=0)
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
}
|
}
|
||||||
doc->x=doc->cur_entry->x+doc->cur_col;
|
doc->x=doc->cur_entry->x+doc->cur_col;
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ public U0 ClipboardDel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
public U0 EdCopyToClipboard(CDoc *doc)
|
public U0 EdCopyToClipboard(CDoc *doc)
|
||||||
{//Copy $LK,"DOCET_SELECTED",A="MN:DOCET_SELECTED"$ flagged entries to clipboard.
|
{//Copy $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ flagged entries to clipboard.
|
||||||
CDoc *doc2=sys_clipboard_doc;
|
CDoc *doc2=sys_clipboard_doc;
|
||||||
Bool unlock_doc=DocLock(doc),
|
Bool unlock_doc=DocLock(doc),
|
||||||
unlock_doc2=DocLock(doc2);
|
unlock_doc2=DocLock(doc2);
|
||||||
CDocEntry *doc_e=doc->root.next,*doc_ne;
|
CDocEntry *doc_e=doc->root.next,*doc_ne;
|
||||||
ClipboardDel;
|
ClipboardDel;
|
||||||
while (doc_e!=doc) {
|
while (doc_e!=doc) {
|
||||||
if (doc_e->type & DOCET_SELECTED) {
|
if (doc_e->type & DOCET_SEL) {
|
||||||
doc_e->type&=~DOCET_SELECTED;
|
doc_e->type&=~DOCET_SEL;
|
||||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||||
QueIns(doc_ne,doc2->root.last);
|
QueIns(doc_ne,doc2->root.last);
|
||||||
@@ -31,7 +31,7 @@ public U0 EdCopyToClipboard(CDoc *doc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
public U0 EdCutToClipboard(CDoc *doc)
|
public U0 EdCutToClipboard(CDoc *doc)
|
||||||
{//Remove selected entries and place on clipboard.
|
{//Remove sel entries and place on clipboard.
|
||||||
CDoc *doc2=sys_clipboard_doc;
|
CDoc *doc2=sys_clipboard_doc;
|
||||||
Bool unlock_doc=DocLock(doc),
|
Bool unlock_doc=DocLock(doc),
|
||||||
unlock_doc2=DocLock(doc2);
|
unlock_doc2=DocLock(doc2);
|
||||||
@@ -39,8 +39,8 @@ public U0 EdCutToClipboard(CDoc *doc)
|
|||||||
ClipboardDel;
|
ClipboardDel;
|
||||||
while (doc_e!=doc) {
|
while (doc_e!=doc) {
|
||||||
doc_e1=doc_e->next;
|
doc_e1=doc_e->next;
|
||||||
if (doc_e->type & DOCET_SELECTED) {
|
if (doc_e->type & DOCET_SEL) {
|
||||||
doc_e->type&=~DOCET_SELECTED;
|
doc_e->type&=~DOCET_SEL;
|
||||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||||
QueIns(doc_ne,doc2->root.last);
|
QueIns(doc_ne,doc2->root.last);
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
#help_index "DolDoc/Misc"
|
#help_index "DolDoc/Misc"
|
||||||
|
|
||||||
U0 EdReplaceTroubleOne(CDoc *doc,U8 *st_original,U8 *st_safe,I64 num,
|
U0 EdReplaceTroubleOne(CDoc *doc,U8 *st_original,U8 *st_safe,I64 num,
|
||||||
Bool to_safe,Bool select)
|
Bool to_safe,Bool sel)
|
||||||
{
|
{
|
||||||
U8 buf[STR_LEN];
|
U8 buf[STR_LEN];
|
||||||
StrPrint(buf,st_safe,num);
|
StrPrint(buf,st_safe,num);
|
||||||
if (to_safe)
|
if (to_safe)
|
||||||
EdReplace(doc,st_original,buf,select);
|
EdReplace(doc,st_original,buf,sel);
|
||||||
else
|
else
|
||||||
EdReplace(doc,buf,st_original,select);
|
EdReplace(doc,buf,st_original,sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 EdReplaceTroubleAll(CDoc *doc,Bool to_safe,Bool select)
|
U0 EdReplaceTroubleAll(CDoc *doc,Bool to_safe,Bool sel)
|
||||||
{
|
{
|
||||||
I64 i=0;
|
I64 i=0;
|
||||||
EdReplaceTroubleOne(doc,"#assert" ,"//<@%d@>" ,i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"#assert" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||||
EdReplaceTroubleOne(doc,"#define" ,"//<@%d@>" ,i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"#define" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||||
EdReplaceTroubleOne(doc,"#include","//<@%d@>" ,i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"#include","//<@%d@>" ,i++,to_safe,sel);
|
||||||
//#if will match #if,#ifdef,#ifndef,#ifaot and #ifjit
|
//#if will match #if,#ifdef,#ifndef,#ifaot and #ifjit
|
||||||
EdReplaceTroubleOne(doc,"#if" ,"//<@%d@>" ,i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"#if" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||||
EdReplaceTroubleOne(doc,"#endif" ,"//<@%d@>" ,i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"#endif" ,"//<@%d@>" ,i++,to_safe,sel);
|
||||||
//Convert #exe to union because we want that indent pattern.
|
//Convert #exe to union because we want that indent pattern.
|
||||||
EdReplaceTroubleOne(doc,"#exe" ,"union @%d@",i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"#exe" ,"union @%d@",i++,to_safe,sel);
|
||||||
EdReplaceTroubleOne(doc,"'{'" ,"'<@%d@>'" ,i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"'{'" ,"'<@%d@>'" ,i++,to_safe,sel);
|
||||||
EdReplaceTroubleOne(doc,"'}'" ,"'<@%d@>'" ,i++,to_safe,select);
|
EdReplaceTroubleOne(doc,"'}'" ,"'<@%d@>'" ,i++,to_safe,sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define C_INDENT_SPACES 2
|
#define C_INDENT_SPACES 2
|
||||||
@@ -76,7 +76,7 @@ I64 EdRILex(CRILex *rx)
|
|||||||
!rx->exp_depth || i==KW_ELSE || i==KW_CATCH || i==KW_DO)
|
!rx->exp_depth || i==KW_ELSE || i==KW_CATCH || i==KW_DO)
|
||||||
rx->is_not_cont=TRUE;
|
rx->is_not_cont=TRUE;
|
||||||
if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE ||
|
if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE ||
|
||||||
i==KW_DFT || i==KW_SUB_SWITCH_START || i==KW_SUB_SWITCH_END)) {
|
i==KW_DFT || i==KW_START || i==KW_END)) {
|
||||||
tempf=rx->cc2->lex_include_stk;
|
tempf=rx->cc2->lex_include_stk;
|
||||||
while (tempf->next)
|
while (tempf->next)
|
||||||
tempf=tempf->next;
|
tempf=tempf->next;
|
||||||
@@ -189,13 +189,13 @@ U0 EdRIStmt(CRILex *rx,Bool indent)
|
|||||||
i=0;
|
i=0;
|
||||||
while (rx->cc1->token && rx->cc1->token!='}') {
|
while (rx->cc1->token && rx->cc1->token!='}') {
|
||||||
switch (PrsKeyWord(rx->cc1)) {
|
switch (PrsKeyWord(rx->cc1)) {
|
||||||
case KW_SUB_SWITCH_START:
|
case KW_START:
|
||||||
rx->depth+=i; i=0;
|
rx->depth+=i; i=0;
|
||||||
while (EdRILex(rx) && rx->cc1->token!=':');
|
while (EdRILex(rx) && rx->cc1->token!=':');
|
||||||
EdRILex(rx);
|
EdRILex(rx);
|
||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
case KW_SUB_SWITCH_END:
|
case KW_END:
|
||||||
rx->depth+=i; i=0;
|
rx->depth+=i; i=0;
|
||||||
if (--rx->depth<0) rx->depth=0;
|
if (--rx->depth<0) rx->depth=0;
|
||||||
while (EdRILex(rx) && rx->cc1->token!=':');
|
while (EdRILex(rx) && rx->cc1->token!=':');
|
||||||
@@ -336,7 +336,7 @@ I64 EdRAGetU8(CDoc *doc)
|
|||||||
{
|
{
|
||||||
I64 res=-1;
|
I64 res=-1;
|
||||||
while (doc->cur_entry!=doc &&
|
while (doc->cur_entry!=doc &&
|
||||||
doc->cur_entry->type&DOCET_SELECTED && res<0) {
|
doc->cur_entry->type&DOCET_SEL && res<0) {
|
||||||
res=EdCurU8(doc);
|
res=EdCurU8(doc);
|
||||||
EdCursorRight(doc);
|
EdCursorRight(doc);
|
||||||
}
|
}
|
||||||
@@ -393,7 +393,7 @@ U0 EdRenumAsm(CDoc *doc)
|
|||||||
buf2[sizeof(CEdFindText.find_text)];
|
buf2[sizeof(CEdFindText.find_text)];
|
||||||
|
|
||||||
QueInit(&root);
|
QueInit(&root);
|
||||||
EdSelectFun(doc,TRUE);
|
EdSelFun(doc,TRUE);
|
||||||
EdRACollect(doc,&root);
|
EdRACollect(doc,&root);
|
||||||
|
|
||||||
tempr=root.next;
|
tempr=root.next;
|
||||||
@@ -412,7 +412,7 @@ U0 EdRenumAsm(CDoc *doc)
|
|||||||
EdReplace(doc,buf,buf2,TRUE,TRUE,TRUE);
|
EdReplace(doc,buf,buf2,TRUE,TRUE,TRUE);
|
||||||
num-=ASM_RENUM_SPACING;
|
num-=ASM_RENUM_SPACING;
|
||||||
}
|
}
|
||||||
EdSelectAll(doc,FALSE);
|
EdSelAll(doc,FALSE);
|
||||||
DocRecalc(doc);
|
DocRecalc(doc);
|
||||||
DocCenter(doc);
|
DocCenter(doc);
|
||||||
if (unlock)
|
if (unlock)
|
||||||
@@ -479,9 +479,10 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
|||||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||||
Free(st);
|
Free(st);
|
||||||
if (FileFind(prj_file))
|
if (FileFind(prj_file))
|
||||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",prj_file);
|
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",prj_file);
|
||||||
else
|
else
|
||||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",TRUE);",doc->filename.name);
|
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
|
||||||
|
doc->filename.name);
|
||||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||||
Free(st);
|
Free(st);
|
||||||
if (JobResScan(tempc,&r) && r)
|
if (JobResScan(tempc,&r) && r)
|
||||||
|
|||||||
+19
-19
@@ -106,8 +106,8 @@ public U0 EdFindNext(CDoc *doc)
|
|||||||
if (doc_e!=doc) {
|
if (doc_e!=doc) {
|
||||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
|
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag &&
|
||||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP))) {
|
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP))) {
|
||||||
if (doc_e->type & DOCET_SELECTED ||
|
if (doc_e->type & DOCET_SEL ||
|
||||||
!doc->find_replace->scan_selected_text) {
|
!doc->find_replace->scan_sel_text) {
|
||||||
if (doc->find_replace->scan_fwd) {
|
if (doc->find_replace->scan_fwd) {
|
||||||
if (doc_e==doc_ce) {
|
if (doc_e==doc_ce) {
|
||||||
ptr=doc_ce->tag+doc->cur_col+1;
|
ptr=doc_ce->tag+doc->cur_col+1;
|
||||||
@@ -167,12 +167,12 @@ fn_skip:
|
|||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public U0 EdSelectAll(CDoc *doc,Bool select)
|
public U0 EdSelAll(CDoc *doc,Bool sel)
|
||||||
{//Set state of $LK,"DOCET_SELECTED",A="MN:DOCET_SELECTED"$ on all entries.
|
{//Set state of $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ on all entries.
|
||||||
Bool unlock=DocLock(doc);
|
Bool unlock=DocLock(doc);
|
||||||
CDocEntry *doc_e=doc->root.next;
|
CDocEntry *doc_e=doc->root.next;
|
||||||
while (doc_e!=doc) {
|
while (doc_e!=doc) {
|
||||||
BEqu(&doc_e->type,DOCEt_SELECTED,select);
|
BEqu(&doc_e->type,DOCEt_SEL,sel);
|
||||||
doc_e=doc_e->next;
|
doc_e=doc_e->next;
|
||||||
}
|
}
|
||||||
if (unlock)
|
if (unlock)
|
||||||
@@ -319,13 +319,13 @@ public Bool EdGoToFun(CDoc *doc,Bool fwd,Bool abort_on_dbl_colon)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public U0 EdSelectFun(CDoc *doc,Bool abort_on_dbl_colon=FALSE)
|
public U0 EdSelFun(CDoc *doc,Bool abort_on_dbl_colon=FALSE)
|
||||||
{//Set $LK,"DOCET_SELECTED",A="MN:DOCET_SELECTED"$ on all entries in cur fun.
|
{//Set $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ on all entries in cur fun.
|
||||||
Bool unlock=DocLock(doc);
|
Bool unlock=DocLock(doc);
|
||||||
U8 *ptr;
|
U8 *ptr;
|
||||||
I64 ch,levels=0,colons=0;
|
I64 ch,levels=0,colons=0;
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
EdSelectAll(doc,FALSE);
|
EdSelAll(doc,FALSE);
|
||||||
EdGoToFun(doc,FALSE,abort_on_dbl_colon);
|
EdGoToFun(doc,FALSE,abort_on_dbl_colon);
|
||||||
if (EdCurU8(doc)=='{')
|
if (EdCurU8(doc)=='{')
|
||||||
levels--;
|
levels--;
|
||||||
@@ -336,7 +336,7 @@ public U0 EdSelectFun(CDoc *doc,Bool abort_on_dbl_colon=FALSE)
|
|||||||
}
|
}
|
||||||
doc_e=doc->cur_entry;
|
doc_e=doc->cur_entry;
|
||||||
while (doc_e!=doc) {
|
while (doc_e!=doc) {
|
||||||
doc_e->type|=DOCET_SELECTED;
|
doc_e->type|=DOCET_SEL;
|
||||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag) {
|
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag) {
|
||||||
ptr=doc_e->tag;
|
ptr=doc_e->tag;
|
||||||
if (doc_e==doc->cur_entry)
|
if (doc_e==doc->cur_entry)
|
||||||
@@ -406,10 +406,10 @@ I64 EdFindReplace(CDoc *doc)
|
|||||||
if (doc_ce->de_flags&DOCEF_TAG && doc_ce->tag &&
|
if (doc_ce->de_flags&DOCEF_TAG && doc_ce->tag &&
|
||||||
!(doc_ce->de_flags&DOCEF_FILTER_SKIP) &&
|
!(doc_ce->de_flags&DOCEF_FILTER_SKIP) &&
|
||||||
StrFind(doc->find_replace->find_text,doc_ce->tag,sf_flags)) {
|
StrFind(doc->find_replace->find_text,doc_ce->tag,sf_flags)) {
|
||||||
doc_ce->type|=DOCET_SELECTED;
|
doc_ce->type|=DOCET_SEL;
|
||||||
res++;
|
res++;
|
||||||
} else
|
} else
|
||||||
doc_ce->type&=~DOCET_SELECTED;
|
doc_ce->type&=~DOCET_SEL;
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ I64 EdFindReplace(CDoc *doc)
|
|||||||
|
|
||||||
doc_e=doc_ce;
|
doc_e=doc_ce;
|
||||||
while (doc_e!=doc && doc_e->y>doc_ce->y-i) {
|
while (doc_e!=doc && doc_e->y>doc_ce->y-i) {
|
||||||
if (doc_e->type&DOCET_SELECTED) {
|
if (doc_e->type&DOCET_SEL) {
|
||||||
found=TRUE;
|
found=TRUE;
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
@@ -430,7 +430,7 @@ I64 EdFindReplace(CDoc *doc)
|
|||||||
if (!found) {
|
if (!found) {
|
||||||
doc_e=doc_ce;
|
doc_e=doc_ce;
|
||||||
while (doc_e!=doc && doc_e->y<doc_ce->y+i) {
|
while (doc_e!=doc && doc_e->y<doc_ce->y+i) {
|
||||||
if (doc_e->type&DOCET_SELECTED) {
|
if (doc_e->type&DOCET_SEL) {
|
||||||
found=TRUE;
|
found=TRUE;
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
@@ -444,12 +444,12 @@ I64 EdFindReplace(CDoc *doc)
|
|||||||
|
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
}
|
}
|
||||||
EdSelectAll(doc,FALSE);
|
EdSelAll(doc,FALSE);
|
||||||
goto fr_unlock_done;
|
goto fr_unlock_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doc->find_replace->local_var)
|
if (doc->find_replace->local_var)
|
||||||
EdSelectFun(doc);
|
EdSelFun(doc);
|
||||||
|
|
||||||
if (!doc->find_replace->replace && !doc->find_replace->local_var) {
|
if (!doc->find_replace->replace && !doc->find_replace->local_var) {
|
||||||
EdFindNext(doc);
|
EdFindNext(doc);
|
||||||
@@ -473,8 +473,8 @@ I64 EdFindReplace(CDoc *doc)
|
|||||||
}
|
}
|
||||||
if (doc_e->type_u8==DOCT_TEXT &&
|
if (doc_e->type_u8==DOCT_TEXT &&
|
||||||
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
|
!(doc_e->de_flags&(DOCEG_DONT_EDIT|DOCEF_FILTER_SKIP)) &&
|
||||||
(doc_e->type & DOCET_SELECTED ||
|
(doc_e->type & DOCET_SEL ||
|
||||||
!doc->find_replace->scan_selected_text&&
|
!doc->find_replace->scan_sel_text&&
|
||||||
!doc->find_replace->local_var)) {
|
!doc->find_replace->local_var)) {
|
||||||
src=doc_e->tag;
|
src=doc_e->tag;
|
||||||
while (src) {
|
while (src) {
|
||||||
@@ -541,7 +541,7 @@ fr_unlock_done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public I64 EdReplace(CDoc *doc,U8 *find,U8 *replace,
|
public I64 EdReplace(CDoc *doc,U8 *find,U8 *replace,
|
||||||
Bool selected=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
|
Bool sel=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
|
||||||
{//Find & replace using editor's cmd.
|
{//Find & replace using editor's cmd.
|
||||||
CEdFindText old_find_replace;
|
CEdFindText old_find_replace;
|
||||||
Bool unlock;
|
Bool unlock;
|
||||||
@@ -557,7 +557,7 @@ Bool selected=TRUE,Bool match_case=TRUE,Bool whole_labels=FALSE)
|
|||||||
if (i<sizeof(CEdFindText.replace_text)) {
|
if (i<sizeof(CEdFindText.replace_text)) {
|
||||||
MemCpy(doc->find_replace->replace_text,replace,i+1);
|
MemCpy(doc->find_replace->replace_text,replace,i+1);
|
||||||
doc->find_replace->replace=TRUE;
|
doc->find_replace->replace=TRUE;
|
||||||
doc->find_replace->scan_selected_text=selected;
|
doc->find_replace->scan_sel_text=sel;
|
||||||
doc->find_replace->match_case=match_case;
|
doc->find_replace->match_case=match_case;
|
||||||
doc->find_replace->whole_labels=whole_labels;
|
doc->find_replace->whole_labels=whole_labels;
|
||||||
doc->find_replace->pmt=FALSE;
|
doc->find_replace->pmt=FALSE;
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ public I64 PopUpColorLighting(U8 *header=NULL)
|
|||||||
CDoc *doc=DocNew;
|
CDoc *doc=DocNew;
|
||||||
if (header)
|
if (header)
|
||||||
DocPrint(doc,"%s",header);
|
DocPrint(doc,"%s",header);
|
||||||
DocPrint(doc,"\nSingle-Sided means both sides same color."
|
DocPrint(doc,"\nSingle-Sided means front and back different."
|
||||||
"\nDouble-Sided means back side darker."
|
"\nDouble-Sided means front and back same."
|
||||||
"\n"
|
"\n"
|
||||||
"\nHalf-Range means 0 to [0,7]"
|
"\nHalf-Range means 0 to [0,7]"
|
||||||
"\n [8,15]-8 to [8,15]"
|
"\n [8,15]-8 to [8,15]"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#help_index "DolDoc/Misc"
|
#help_index "DolDoc/Misc"
|
||||||
|
|
||||||
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
|
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
|
||||||
{//Be aware of $LK,"::/Demo/ToHtmlToTXTExample/ToHtml.CPP"$.
|
{//Be aware of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.CPP"$.
|
||||||
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
|
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
|
||||||
U8 *ptr;
|
U8 *ptr;
|
||||||
CDocSettings *s=&doc_e->settings;
|
CDocSettings *s=&doc_e->settings;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ I64 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
|
|||||||
if (res<64) {
|
if (res<64) {
|
||||||
BEqu(_de_flags,res,turn_on);
|
BEqu(_de_flags,res,turn_on);
|
||||||
switch (res) {
|
switch (res) {
|
||||||
case DOCEf_SELECTED:
|
case DOCEf_SEL:
|
||||||
case DOCEf_UNDERLINE:
|
case DOCEf_UNDERLINE:
|
||||||
case DOCEf_INVERT:
|
case DOCEf_INVERT:
|
||||||
case DOCEf_BLINK:
|
case DOCEf_BLINK:
|
||||||
@@ -56,7 +56,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
|||||||
f1=doldoc.dft_de_flags[doc_e->type_u8];
|
f1=doldoc.dft_de_flags[doc_e->type_u8];
|
||||||
t1=doc_e->type_u8|doldoc.dft_type_flags[doc_e->type_u8];
|
t1=doc_e->type_u8|doldoc.dft_type_flags[doc_e->type_u8];
|
||||||
|
|
||||||
de_flags=doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_SELECTED|
|
de_flags=doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_SEL|
|
||||||
DOCEF_HIGHLIGHT|DOCEF_WORD_WRAP|DOCEF_SKIP|DOCEF_FILTER_SKIP);
|
DOCEF_HIGHLIGHT|DOCEF_WORD_WRAP|DOCEF_SKIP|DOCEF_FILTER_SKIP);
|
||||||
for (i=0;i<DOCEf_NUM_FLAGS;i++)
|
for (i=0;i<DOCEf_NUM_FLAGS;i++)
|
||||||
if (Bt(&f1,i)!=Bt(&de_flags,i)) {
|
if (Bt(&f1,i)!=Bt(&de_flags,i)) {
|
||||||
@@ -70,7 +70,7 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
|||||||
Free(buf); buf=buf2;
|
Free(buf); buf=buf2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
type=doc_e->type&~DOCET_SELECTED;
|
type=doc_e->type&~DOCET_SEL;
|
||||||
for (i=DOCEt_BLINK;i<=DOCEt_UNDERLINE;i++)
|
for (i=DOCEt_BLINK;i<=DOCEt_UNDERLINE;i++)
|
||||||
if (Bt(&t1,i)!=Bt(&type,i)) {
|
if (Bt(&t1,i)!=Bt(&type,i)) {
|
||||||
if (Bt(&type,i))
|
if (Bt(&type,i))
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ public U8 *PopUpPickLst(U8 *lst)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#help_index "DolDoc/Input;Char/Lists;Char/Define;StdIn/DolDoc"
|
||||||
public U8 *PopUpPickDefineSub(U8 *dname)
|
public U8 *PopUpPickDefineSub(U8 *dname)
|
||||||
{//Prompt for $LK,"Define",A="HI:Define"$ lst entry in PopUp win task.
|
{//Prompt for $LK,"Define",A="HI:Define"$ lst entry in PopUp win task.
|
||||||
return PopUpPickLst(Define(dname));
|
return PopUpPickLst(Define(dname));
|
||||||
@@ -295,7 +296,8 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
|
|||||||
okay=FALSE;
|
okay=FALSE;
|
||||||
if (okay) {
|
if (okay) {
|
||||||
st=MStrPrint(
|
st=MStrPrint(
|
||||||
"\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\");\\n\");UserTaskCont;",
|
"\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
||||||
|
"UserTaskCont;",
|
||||||
name2);
|
name2);
|
||||||
res=PopUp(st,parent,_pu_task);
|
res=PopUp(st,parent,_pu_task);
|
||||||
Free(st);
|
Free(st);
|
||||||
|
|||||||
+12
-12
@@ -45,7 +45,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
if (!(sc&SCF_CTRL)) {
|
if (!(sc&SCF_CTRL)) {
|
||||||
if (sc&SCF_KEY_DESC) {
|
if (sc&SCF_KEY_DESC) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/Cursor Down, Select");
|
KeyDescSet("Edit/Cursor Down, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/Cursor Down");
|
KeyDescSet("Edit/Cursor Down");
|
||||||
} else
|
} else
|
||||||
@@ -58,12 +58,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
if (!(sc&SCF_CTRL)) {
|
if (!(sc&SCF_CTRL)) {
|
||||||
if (sc&SCF_KEY_DESC) {
|
if (sc&SCF_KEY_DESC) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/GoTo Doc End, Select");
|
KeyDescSet("Edit/GoTo Doc End, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/GoTo Doc End");
|
KeyDescSet("Edit/GoTo Doc End");
|
||||||
} else {
|
} else {
|
||||||
while (doc_ce!=doc) {
|
while (doc_ce!=doc) {
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc_ce=doc->cur_entry=doc_ce->next;
|
doc_ce=doc->cur_entry=doc_ce->next;
|
||||||
}
|
}
|
||||||
doc->cur_col=doc_ce->min_col;
|
doc->cur_col=doc_ce->min_col;
|
||||||
@@ -75,7 +75,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
if (!(sc&SCF_CTRL)) {
|
if (!(sc&SCF_CTRL)) {
|
||||||
if (sc&SCF_KEY_DESC) {
|
if (sc&SCF_KEY_DESC) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/Cursor Up, Select");
|
KeyDescSet("Edit/Cursor Up, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/Cursor Up");
|
KeyDescSet("Edit/Cursor Up");
|
||||||
} else
|
} else
|
||||||
@@ -88,13 +88,13 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
if (!(sc&SCF_CTRL)) {
|
if (!(sc&SCF_CTRL)) {
|
||||||
if (sc&SCF_KEY_DESC) {
|
if (sc&SCF_KEY_DESC) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/GoTo Top of Doc, Select");
|
KeyDescSet("Edit/GoTo Top of Doc, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/GoTo Top of Doc");
|
KeyDescSet("Edit/GoTo Top of Doc");
|
||||||
} else {
|
} else {
|
||||||
if (doc_ce==doc) doc_ce=doc_ce->last;
|
if (doc_ce==doc) doc_ce=doc_ce->last;
|
||||||
while (doc_ce!=doc) {
|
while (doc_ce!=doc) {
|
||||||
BEqu(&doc_ce->type,DOCEt_SELECTED,sc&SCF_SHIFT);
|
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
doc_ce=doc->cur_entry=doc_ce->last;
|
doc_ce=doc->cur_entry=doc_ce->last;
|
||||||
}
|
}
|
||||||
doc_ce=doc->cur_entry=doc->root.next;
|
doc_ce=doc->cur_entry=doc->root.next;
|
||||||
@@ -107,7 +107,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
if (!(sc&SCF_CTRL)) {
|
if (!(sc&SCF_CTRL)) {
|
||||||
if (sc&SCF_KEY_DESC) {
|
if (sc&SCF_KEY_DESC) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/Page Down, Select");
|
KeyDescSet("Edit/Page Down, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/Page Down");
|
KeyDescSet("Edit/Page Down");
|
||||||
} else {
|
} else {
|
||||||
@@ -131,7 +131,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
if (!(sc&SCF_CTRL)) {
|
if (!(sc&SCF_CTRL)) {
|
||||||
if (sc&SCF_KEY_DESC) {
|
if (sc&SCF_KEY_DESC) {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/Page Up, Select");
|
KeyDescSet("Edit/Page Up, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/Page Up");
|
KeyDescSet("Edit/Page Up");
|
||||||
}else {
|
}else {
|
||||||
@@ -158,7 +158,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
KeyDescSet("Edit/GoTo Start of Line");
|
KeyDescSet("Edit/GoTo Start of Line");
|
||||||
else {
|
else {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/Cursor Left, Select");
|
KeyDescSet("Edit/Cursor Left, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/Cursor Left");
|
KeyDescSet("Edit/Cursor Left");
|
||||||
}
|
}
|
||||||
@@ -171,7 +171,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
KeyDescSet("Edit/GoTo End of Line");
|
KeyDescSet("Edit/GoTo End of Line");
|
||||||
else {
|
else {
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
KeyDescSet("Edit/Cursor Right, Select");
|
KeyDescSet("Edit/Cursor Right, Sel");
|
||||||
else
|
else
|
||||||
KeyDescSet("Edit/Cursor Right");
|
KeyDescSet("Edit/Cursor Right");
|
||||||
}
|
}
|
||||||
@@ -505,12 +505,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
|||||||
if (sc&SCF_KEY_DESC)
|
if (sc&SCF_KEY_DESC)
|
||||||
KeyDescSet("Cmd /Personal Notes");
|
KeyDescSet("Cmd /Personal Notes");
|
||||||
else
|
else
|
||||||
Ed("::/Home/PersonalNotes.TXT.Z");
|
Ed("~/PersonalNotes.TXT.Z");
|
||||||
} else {
|
} else {
|
||||||
if (sc&SCF_KEY_DESC)
|
if (sc&SCF_KEY_DESC)
|
||||||
KeyDescSet("Cmd /Personal Menu");
|
KeyDescSet("Cmd /Personal Menu");
|
||||||
else {
|
else {
|
||||||
m=DocRead("::/Home/PersonalMenu.TXT.Z");
|
m=DocRead("~/PersonalMenu.TXT.Z");
|
||||||
DocMenu(m);
|
DocMenu(m);
|
||||||
DocDel(m);
|
DocDel(m);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -968,7 +968,7 @@ rc_adjust_xy:
|
|||||||
i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
|
i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
|
||||||
else {
|
else {
|
||||||
i=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
i=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||||||
if (temp_u32_attr & DOCET_SELECTED)
|
if (temp_u32_attr & DOCET_SEL)
|
||||||
i^=0xF;
|
i^=0xF;
|
||||||
if (temp_u32_attr & DOCET_INVERT)
|
if (temp_u32_attr & DOCET_INVERT)
|
||||||
i^=0xF;
|
i^=0xF;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||||
Bool exited,I64 *_has_action=NULL)
|
Bool exited,I64 *_has_action=NULL)
|
||||||
{//Do action on final entry selected by user.
|
{//Do action on final entry sel by user.
|
||||||
//Sometimes returns locked, sometimes unlocked
|
//Sometimes returns locked, sometimes unlocked
|
||||||
U8 ch=doc->cmd_U8,*st;
|
U8 ch=doc->cmd_U8,*st;
|
||||||
I64 res=DOCM_CANCEL,has_action=FALSE;
|
I64 res=DOCM_CANCEL,has_action=FALSE;
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
|||||||
}
|
}
|
||||||
"#include \"%s\";\n$$PT$$$$FG$$$$BG$$",st;
|
"#include \"%s\";\n$$PT$$$$FG$$$$BG$$",st;
|
||||||
WinZBufUpdate;
|
WinZBufUpdate;
|
||||||
ExeFile(st);
|
ExeFile(st,CCF_CMD_LINE);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
break;
|
break;
|
||||||
case RIGHT_AINCLUDE:
|
case RIGHT_AINCLUDE:
|
||||||
|
|||||||
@@ -114,13 +114,11 @@ mt_done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#help_index "DolDoc/Compiler;Compiler"
|
#help_index "DolDoc/Compiler;Compiler"
|
||||||
public I64 ExeDoc(CDoc *doc,Bool just_load=FALSE)
|
public I64 ExeDoc(CDoc *doc,I64 ccf_flags=0)
|
||||||
{//JIT Compile and execute a document.
|
{//JIT Compile and execute a document.
|
||||||
I64 res;
|
I64 res;
|
||||||
Bool okay=TRUE,unlock_doc=DocLock(doc);
|
Bool okay=TRUE,unlock_doc=DocLock(doc);
|
||||||
CCmpCtrl *cc=CmpCtrlNew(,CCF_DONT_FREE_BUF);
|
CCmpCtrl *cc=CmpCtrlNew(,ccf_flags|CCF_DONT_FREE_BUF);
|
||||||
if (just_load)
|
|
||||||
cc->flags|=CCF_JUST_LOAD;
|
|
||||||
if (Fs->last_lex!=&Fs->next_lex)
|
if (Fs->last_lex!=&Fs->next_lex)
|
||||||
cc->opts=Fs->last_lex->opts;
|
cc->opts=Fs->last_lex->opts;
|
||||||
QueIns(cc,Fs->last_lex);
|
QueIns(cc,Fs->last_lex);
|
||||||
|
|||||||
@@ -860,7 +860,7 @@ U0 EdInsCheckBox()
|
|||||||
|
|
||||||
class CEdLst
|
class CEdLst
|
||||||
{
|
{
|
||||||
U8 tag[512] fmtstr "$$DA-P,A=\"Dft Select :%s\"$$\n",
|
U8 tag[512] fmtstr "$$DA-P,A=\"Dft Sel :%s\"$$\n",
|
||||||
define_str[512] fmtstr "$$DA-P,A=\"Define Str :%s\"$$\n";
|
define_str[512] fmtstr "$$DA-P,A=\"Define Str :%s\"$$\n";
|
||||||
Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n";
|
Bool refresh fmtstr "$$CB,\"Refresh Data\"$$\n";
|
||||||
I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n";
|
I64 type fmtstr "$$LS,D=\"ST_INT_SIZE_TYPES\"$$\n";
|
||||||
|
|||||||
+13
-13
@@ -4,13 +4,13 @@ $WW,1$The Catholic purpose of life is to know God, love God and obey God.$FG$ P
|
|||||||
|
|
||||||
You don't know God. $LK,"1 Chronicles,28:9-9",A="BF:1 Chronicles,28:9-9"$, $LK,"Matthew,11:27-27",A="BF:Matthew,11:27-27"$, $LK,"Luke,13:25-27",A="BF:Luke,13:25-27"$, $LK,"1 Samuel,3:6-8",A="BF:1 Samuel,3:6-8"$ You must talk with God to know Him. With Samuel, supposedly, God took the initiative, but I think that is the exception. Seek the Lord by taking the initiative. $LK,"Luke,11:9-10",A="BF:Luke,11:9-10"$, $LK,"Isaiah,30:1-2",A="BF:Isaiah,30:1-2"$
|
You don't know God. $LK,"1 Chronicles,28:9-9",A="BF:1 Chronicles,28:9-9"$, $LK,"Matthew,11:27-27",A="BF:Matthew,11:27-27"$, $LK,"Luke,13:25-27",A="BF:Luke,13:25-27"$, $LK,"1 Samuel,3:6-8",A="BF:1 Samuel,3:6-8"$ You must talk with God to know Him. With Samuel, supposedly, God took the initiative, but I think that is the exception. Seek the Lord by taking the initiative. $LK,"Luke,11:9-10",A="BF:Luke,11:9-10"$, $LK,"Isaiah,30:1-2",A="BF:Isaiah,30:1-2"$
|
||||||
|
|
||||||
There's something obviously different about people in the Bible compared to people today -- God talked! Also, the people in the Bible were obsessed with doing offerings all the time. It is required that you do offerings before God will talk. Did the people in the Bible hear voices? Maybe. More likely, they used occult techniques such as an oracle. $LK,"1 Kings,6:20-23",A="BF:1 Kings,6:20-23"$ Have you heard of "tongues?" $LK,"1 Corinthians,14:1-40",A="BF:1 Corinthians,14:1-40"$ The idea is, you let yourself be puppeted by a spirit, so you say things. You try to get a spirit -- the Holy Spirit -- to talk. You might as well use a Ouija board. However, it turns-out that a Ouija board is bad for technical reasons. A really good technique is just randomly opening a book. God told me in an oracle that it is a covenant that you hold-up your end of the conversation.
|
There's something obviously different about people in the Bible compared to people today -- God talked! Also, the people in the Bible were obsessed with doing offerings all the time. It is required that you do offerings before God will talk. Did the people in the Bible hear voices? Maybe. More likely, they used occult techniques such as an oracle. $LK,"1 Kings,6:21",A="BF:1 Kings,6:21"$ Have you heard of "tongues?" $LK,"1 Corinthians,14:1-40",A="BF:1 Corinthians,14:1-40"$ The idea is, you let yourself be puppeted by a spirit, so you say things. You try to get a spirit -- the Holy Spirit -- to talk. You might as well use a Ouija board. However, it turns-out that a Ouija board is bad for technical reasons. A really good technique is just randomly opening a book. God told me in an oracle that it is a covenant that you hold-up your end of the conversation.
|
||||||
|
|
||||||
You can't tell if God's talking unless you have a context of conversation, but, more importantly, you are commanded to do an offering of love, like communion preparation. $LK,"1 Corinthians,11:27",A="BF:1 Corinthians,11:27"$ When you pick a greeting card for someone, that is love effort. If you expect God to put effort toward you, you must put effort toward Him. God said, "honest measures" applies between your offering of love and His response, like a fair barter. You get out of prayer what you put into it. God wants praise, hymns, or whatever you think He might want. Try and see, like Cain and Abel. $LK,"Genesis,4:1",A="BF:Genesis,4:1"$, $LK,"Ephesians,5:10",A="BF:Ephesians,5:10"$ God told Cain his offering was not good and told him to try again. Cain really loved God! Can you imagine being so heart-broken?
|
You can't tell if God's talking unless you have a context of conversation, but, more importantly, you are commanded to do an offering of love, like communion preparation. $LK,"1 Corinthians,11:27",A="BF:1 Corinthians,11:27"$ When you pick a greeting card for someone, that is love effort. If you expect God to put effort toward you, you must put effort toward Him. God said, "honest measures" applies between your offering of love and His response, like a fair barter. You get out of prayer what you put into it. God wants praise, hymns, or whatever you think He might want. Try and see, like Cain and Abel. $LK,"Genesis,4:1-10",A="BF:Genesis,4:1-10"$, $LK,"Ephesians,5:10",A="BF:Ephesians,5:10"$ God told Cain his offering was not good and told him to try again. Cain really loved God! Can you imagine being so heart-broken?
|
||||||
|
|
||||||
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses $MA-X+PU,"comics",HTML="http://www.templeos.org/Wb/Home/Downloads/Comics/",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n"$ for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:29",A="BF:Matthew,6:29"$
|
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses $MA-X+PU,"comics",HTML="http://www.templeos.org/Wb/Home/Downloads/Comics/",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n"$ for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:28-29",A="BF:Matthew,6:28-29"$
|
||||||
|
|
||||||
This is funny -- $LK,"Acts,2:1",A="BF:Acts,2:1"$ -- they didn't bother to record anything the Holy Spirit said. The Holy Spirit is supposed to be a really good gift. $LK,"Luke,11:13",A="BF:Luke,11:13"$ Just remember, "Boys are made of snakes and snails and puppy-dog tails."
|
This is funny -- $LK,"Acts,2:1-13",A="BF:Acts,2:1-13"$ -- they didn't bother to record anything the Holy Spirit said. The Holy Spirit is supposed to be a really good gift. $LK,"Luke,11:11-13",A="BF:Luke,11:11-13"$ Just remember, "Boys are made of snakes and snails and puppy-dog tails."
|
||||||
|
|
||||||
The technique I use to consult the Holy Spirit is reading a microsecond-range stop-watch each button press for random numbers. Then, I pick words or passages. You can use the $MA-X+PU,"AfterEgypt",HTML="http://www.youtube.com/watch?v=P0MsDl39UL0",LM="#include \"::/Apps/AfterEgypt/Run\""$ in God's official temple, $FG,4$$TX,"TempleOS",HTML="http://www.templeos.org"$$FG$.
|
The technique I use to consult the Holy Spirit is reading a microsecond-range stop-watch each button press for random numbers. Then, I pick words or passages. You can use the $MA-X+PU,"AfterEgypt",HTML="http://www.youtube.com/watch?v=P0MsDl39UL0",LM="#include \"::/Apps/AfterEgypt/Run\""$ in God's official temple, $FG,4$$TX,"TempleOS",HTML="http://www.templeos.org"$$FG$.
|
||||||
|
|
||||||
@@ -18,29 +18,29 @@ Since seeking the word of the Holy Spirit, I have come to know God much better t
|
|||||||
|
|
||||||
I asked God if the World was perfectly just. God asked if I was calling Him lazy. God could make A.I., right? God could make bots as smart as Himself, or, in fact, part of Himself. What if God made a bot to manipulate every person's life so that perfect justice happened?
|
I asked God if the World was perfectly just. God asked if I was calling Him lazy. God could make A.I., right? God could make bots as smart as Himself, or, in fact, part of Himself. What if God made a bot to manipulate every person's life so that perfect justice happened?
|
||||||
|
|
||||||
I think highs and lows balance. $LK,"Luke,6:20",A="BF:Luke,6:20"$ If you laugh, you will cry. If you cry, you will laugh. Not one person has had great joy and not great sorrow. I think this claim is falsifyable if you atheists want to find a counter-example to disprove it -- find a single person who had great joy and not great sorrow. In Sirach, it says things happen in pairs. You might be surprised examining your own life to see great joy was in proximity to great sorrow. Pleasures and pains seem designed to balance. Man must do manual labor and have pain. Women must do child birth. Pride and humility also balance -- pride before a fall and humility before honors. Palm Sunday is juxtaposed to Good Friday. Perhaps, being loved balances with being hated. $LK,"Job",A="BF:Job,1:1"$, in the Bible, had highs and lows that balanced. Joseph, in the Old Testament, had highs and lows that balanced. $LK,"Genesis,39:20",A="BF:Genesis,39:20"$
|
I think highs and lows balance. $LK,"Luke,6:20-26",A="BF:Luke,6:20-26"$ If you laugh, you will cry. If you cry, you will laugh. Not one person has had great joy and not great sorrow. I think this claim is falsifyable if you atheists want to find a counter-example to disprove it -- find a single person who had great joy and not great sorrow. In Sirach, it says things happen in pairs. You might be surprised examining your own life to see great joy was in proximity to great sorrow. Pleasures and pains seem designed to balance. Man must do manual labor and have pain. Women must do child birth. Pride and humility also balance -- pride before a fall and humility before honors. Palm Sunday is juxtaposed to Good Friday. Perhaps, being loved balances with being hated. $LK,"Job,1:1-22",A="BF:Job,1:1-22"$, in the Bible, had highs and lows that balanced. Joseph, in the Old Testament, had highs and lows that balanced. $LK,"Genesis,39:17-22",A="BF:Genesis,39:17-22"$
|
||||||
|
|
||||||
Jesus said, "Forgive us our trespasses as we forgive those who tresspass against us." If you think about it, the only way you get forgiven is for it to be done to you. That is a Jedi mind trick because it is nothing but simple eye-for-eye tooth-for-tooth justice. Live by the sword; die by the sword. The Bible is filled with justice pairs. St. Paul persecuted Christians and gained forgiveness by getting persecuted. King David almost got killed by Saul, then he killed a guy and took his wife. Abraham almost killed his unloved son, Ishmael. $LK,"Genesis,21:16",A="BF:Genesis,21:16"$ That is why God asked Abraham to kill Isaac. God's favorite thing on TV is soap operas.
|
Jesus said, "Forgive us our trespasses as we forgive those who tresspass against us." If you think about it, the only way you get forgiven is for it to be done to you. That is a Jedi mind trick because it is nothing but simple eye-for-eye tooth-for-tooth justice. Live by the sword; die by the sword. The Bible is filled with justice pairs. St. Paul persecuted Christians and gained forgiveness by getting persecuted. King David almost got killed by Saul, $LK,"1 Samuel,18:20-21",A="BF:1 Samuel,18:20-21"$ then he killed a guy and took his wife. $LK,"2 Samuel,11:15",A="BF:2 Samuel,11:15"$ Abraham almost killed his unloved son, Ishmael. $LK,"Genesis,21:16",A="BF:Genesis,21:16"$ That is why God asked Abraham to kill Isaac. God's favorite thing on TV is soap operas.
|
||||||
|
|
||||||
God hates complaining. $LK,"Numbers,11:1",A="BF:Numbers,11:1"$ Food and clothing is all we're to ask for or demand, in fact -- daily bread. $LK,"1 Timothy,6:8",A="BF:1 Timothy,6:8"$ Just think about man in the last 100,000 years mostly living like Native Americans and how God must see us. You need food, clothing and entertainment, money is to get those. Man does not live on bread alone. $LK,"Luke,4:4",A="BF:Luke,4:4"$, $LK,"Amos,8:11",A="BF:Amos,8:11"$
|
God hates complaining. $LK,"Numbers,11:1-35",A="BF:Numbers,11:1-35"$ Food and clothing is all we're to ask for or demand, in fact -- daily bread. $LK,"1 Timothy,6:8",A="BF:1 Timothy,6:8"$ Just think about man in the last 50,000 years mostly living like Native Americans and how God must see us. You need food, clothing and entertainment, money is to get those. Man does not live on bread alone. $LK,"Luke,4:4",A="BF:Luke,4:4"$, $LK,"Amos,8:11-12",A="BF:Amos,8:11-12"$
|
||||||
|
|
||||||
God's favorite animals are bears and elephants. They are funny shaped -- I think God must have seen too much starvation over the years. If the purpose of life is to know and love God, then a priest's job is to make everybody know and love God. By saying God likes bears and elephants, I did more toward that end than all priests in history. $LK,"Hosea,6:6",A="BF:Hosea,6:6"$ "It is love that I desire, not sacrifice; knowledge of God, not holocaust." As a former Catholic, that blew my mind. I actually thought love was sacrifice! I was so dumb-founded reading, "it is love that I desire, not sacrifice," that I actually looked-up the word, "love". It means to take delight in. I realized it is demonic pride if you think love means hurting yourself for others. In the Philippians, they got the notion crucifying yourself was a good idea. Similarly, a child thinking about Lent, might conclude, "if it's bad, it must be good." That is, if you think God wants you to hurt yourself to please Him, you are worshiping a demon, not God! God wants you to take delight in His company, get to know Him and praise Him. It is best to separate justice -- sin and punishment -- from relationship with God. Never ask God to change justice into injustice by not punishing. God said to me in an oracle, "Excessive contrician wearisome." He doesn't want to hear confessions. When you pray, be witty and charming and rarely earnest. Enjoy God's company without imposing on Him and don't expect secrets of the Universe. Earnestness in prayer is the root of much evil. Be entertaining. Don't remind Him of sin, LOL.
|
God's favorite animals are bears and elephants. They are funny shaped -- I think God must have seen too much starvation over the years. If the purpose of life is to know and love God, then a priest's job is to make everybody know and love God. By saying God likes bears and elephants, I did more toward that end than all priests in history. $LK,"Hosea,6:6",A="BF:Hosea,6:6"$ "It is love that I desire, not sacrifice; knowledge of God, not holocaust." As a former Catholic, that blew my mind. I actually thought love was sacrifice! I was so dumb-founded reading, "it is love that I desire, not sacrifice," that I actually looked-up the word, "love". It means to take delight in. I realized it is demonic pride if you think love means hurting yourself for others. In the Philippians, they got the notion crucifying yourself was a good idea. Similarly, a child thinking about Lent, might conclude, "if it's bad, it must be good." That is, if you think God wants you to hurt yourself to please Him, you are worshiping a demon, not God! God wants you to take delight in His company, get to know Him and praise Him. It is best to separate justice -- sin and punishment -- from relationship with God. Never ask God to change justice into injustice by not punishing. God said to me in an oracle, "Excessive contrician wearisome." He doesn't want to hear confessions. When you pray, be witty and charming and rarely earnest. Enjoy God's company without imposing on Him and don't expect secrets of the Universe. Earnestness in prayer is the root of much evil. Be entertaining. Don't remind Him of sin, LOL.
|
||||||
|
|
||||||
God's ways are far above man's ways. Mom said Heaven was a never-ending family reunion. Yikes! A friend said, "Most guy's idea of Heaven would be running around doing things they'd get locked up for on Earth." I wonder how long kids play Grand Theft Auto before getting board. Perhaps, it takes ten years, but they will get bored. Most people are like King Midas. When you realize how silly most notions of Heaven are, you come to appreciate that Earth is not that bad. This is the first step in loving God, the Creator -- praising Creation. My parents spend their retired days watching TV and going to casinos. That's not a good argument for getting extended-play!
|
God's ways are far above man's ways. Mom said Heaven was a never-ending family reunion. Yikes! A friend said, "Most guy's idea of Heaven would be running around doing things they'd get locked up for on Earth." I wonder how long kids play Grand Theft Auto before getting board. Perhaps, it takes ten years, but they will get bored. Most people are like King Midas. When you realize how silly most notions of Heaven are, you come to appreciate that Earth is not that bad. This is the first step in loving God, the Creator -- praising Creation. My parents spend their retired days watching TV and going to casinos. That's not a good argument for getting extended-play!
|
||||||
|
|
||||||
Imagine a billionare. Everyone around him can't forget his money for even a moment. The truth is, most people are after God's "money" -- they fear for their salvation. Here's a test -- would you pray to and praise God even if there were no salvation? Love God and don't be a "user". Asking for stuff is annoying. $LK,"Luke,11:5",A="BF:Luke,11:5"$
|
Imagine a billionare. Everyone around him can't forget his money for even a moment. The truth is, most people are after God's "money" -- they fear for their salvation. Here's a test -- would you pray to and praise God even if there were no salvation? Love God and don't be a "user". Asking for stuff is annoying. $LK,"Luke,11:5-7",A="BF:Luke,11:5-7"$ Don't SPAM God.
|
||||||
|
|
||||||
All those sophisticated theological "infinity" things -- omniscience, omnipotence, omnipresence, omnivorous -- will mess you up. Trust me that anthropomorphic is far better, in practice. Christ suggested thinking of God as "Abba" which is Aramaic for "Daddy" and said the childlike had an advantage. $LK,"Matthew,11:25",A="BF:Matthew,11:25"$ Pray out-loud because God doesn't want the hastle of reading your brain. The best way to stop people from testing God is to suggest He can't do everything.
|
All those sophisticated theological "infinity" things -- omniscience, omnipotence, omnipresence, omnivorous -- will mess you up. Trust me that anthropomorphic is far better, in practice. Christ suggested thinking of God as "Abba" which is Aramaic for "Daddy" and said the childlike had an advantage. $LK,"Matthew,11:25",A="BF:Matthew,11:25"$ Pray out-loud because God doesn't want the hastle of reading your brain. The best way to stop people from testing God is to suggest He can't do everything.
|
||||||
|
|
||||||
Jesus said, "I am meek and humble of heart." $LK,"Matthew,11:29",A="BF:Matthew,11:29"$ What does "humble of head" mean? Humble of heart means you look around and say, "I don't care as much as they do." A proud of heart person says, "I am superior because I have more compassion then everybody else." If you are proud of heart, you don't accept a gift. God gives birthrights. Esau, in the Bible, scorned his birthright and God hated him. $LK,"Malachi,1:1",A="BF:Malachi,1:1"$ Jesus even accepted $$30,000 worth of perfume (300 day's wages) and caused Judas to betray him. $LK,"Mark,14:5",A="BF:Mark,14:5"$ If you express false outrage at wars, you are proud of heart. If you fight to go in the door last, e.g. "No, you first..." then you are proud of heart. If you ask God to save starving Africans as though you care more than God, you are proud of heart.
|
Jesus said, "I am meek and humble of heart." $LK,"Matthew,11:29",A="BF:Matthew,11:29"$ What does "humble of head" mean? Humble of heart means you look around and say, "I don't care as much as they do." A proud of heart person says, "I am superior because I have more compassion then everybody else." If you are proud of heart, you don't accept a gift. God gives birthrights. Esau, in the Bible, scorned his birthright and God hated him. $LK,"Malachi,1:2-3",A="BF:Malachi,1:2-3"$ Jesus even accepted $$30,000 worth of perfume (300 day's wages) and caused Judas to betray him. $LK,"Mark,14:5",A="BF:Mark,14:5"$ If you express false outrage at wars, you are proud of heart. If you fight to go in the door last, e.g. "No, you first..." then you are proud of heart. If you ask God to save starving Africans as though you care more than God, you are proud of heart.
|
||||||
|
|
||||||
I connected being humble of heart with animal sacrifices. The animal sacrifices in the Bible really seem off-the-mark from what we modern people imagine truth to be! I asked God and He said the people were, "primitive." Well, obviously, a sacrifice represents giving-up something of value, but is there more to it? It would be tramatic to see a goat's throat being slit and it dying for your sins. I'm not an expert, but sometimes they killed animals to make-up for sins. Perhaps, starting at age eight and every year thereafter, they kill a goat for your sins? (I'm just speculating.) In a couple years, it is not tramatic and you yawn and say to the goat, "bummer for you, Mr. Goat, that you gotta die for my sins." When a high school football team beats their rivals, nobody thinks twice that the winning team really hurts the feelings -- devastates -- the losing team member's feelings. The heart of being masculine is being competetive and not caring about the necessity to slit the throat of the goat. As a Catholic, saying Jesus died for our sins and that we cannot earn salvation, never sat well. I clung to the heretical notion that you earn salvation. Animal sacrifices were the heart of Biblical Judaism and although it seems satanic, you really do have to slit the throat of the goat and accept grace, a term for something you did not earn. Heck, every time you eat beef, a cow had to die for you. God said to me in an oracle that having pets was, "homo." I think God's idea of pets is farm animals you eat.
|
I connected being humble of heart with animal sacrifices. The animal sacrifices in the Bible really seem off-the-mark from what we modern people imagine truth to be! I asked God and He said the people were, "primitive." Well, obviously, a sacrifice represents giving-up something of value, but is there more to it? It would be tramatic to see a goat's throat being slit and it dying for your sins. I'm not an expert, but sometimes they killed animals to make-up for sins. Perhaps, starting at age eight and every year thereafter, they kill a goat for your sins? (I'm just speculating.) In a couple years, it is not tramatic and you yawn and say to the goat, "bummer for you, Mr. Goat, that you gotta die for my sins." When a high school football team beats their rivals, nobody thinks twice that the winning team really hurts the feelings -- devastates -- the losing team member's feelings. The heart of being masculine is being competetive and not caring about the necessity to slit the throat of the goat. As a Catholic, saying Jesus died for our sins and that we cannot earn salvation, never sat well. I clung to the heretical notion that you earn salvation. Animal sacrifices were the heart of Biblical Judaism and although it seems satanic, you really do have to slit the throat of the goat and accept grace, a term for something you did not earn. Heck, every time you eat beef, a cow had to die for you. God said to me in an oracle that having pets was, "homo." I think God's idea of pets is farm animals you eat.
|
||||||
|
|
||||||
If you feel guilty for being American and want Mexicans to share your birthright, you are proud of heart. Jesus was a racist and called Canaanites "dogs". $LK,"Matthew,15:26",A="BF:Matthew,15:26"$ In an oracle, God told me He was against immigration. The Chinese intellectuals felt bad about not being laborers. Don't feel guilty about not being a laborer because God made it a Brave New World. $LK,"1 Corinthians,12:1",A="BF:1 Corinthians,12:1"$
|
If you feel guilty for being American and want Mexicans to share your birthright, you are proud of heart. Jesus was a racist and called Canaanites "dogs". $LK,"Matthew,15:22-28",A="BF:Matthew,15:22-28"$ In an oracle, God told me He was against immigration. The Chinese intellectuals felt bad about not being laborers. Don't feel guilty about not being a laborer because God made it a Brave New World. $LK,"1 Corinthians,12:1-31",A="BF:1 Corinthians,12:1-31"$
|
||||||
|
|
||||||
In an ant colony, the workers have one set of marching orders, the soldiers have another set of marching orders, the queen and drones have marching orders and the diggers have marching orders. The Bible gives conflicting orders -- conservatives pay attention to one set of passages and liberals pay attention to others. Everybody has selective hearing, but that's good because we are different members of the body of Christ.
|
In an ant colony, the workers have one set of marching orders, the soldiers have another set of marching orders, the queen and drones have marching orders and the diggers have marching orders. The Bible gives conflicting orders -- conservatives pay attention to one set of passages and liberals pay attention to others. Everybody has selective hearing, but that's good because we are different members of the body of Christ.
|
||||||
|
|
||||||
Jesus repeats the phrase, "for those who have ears to hear" many times, but not actually at the times that matter. Jesus says several Jedi mind tricks -- He asks, what father gives a scorpion to his son? $LK,"Luke,11:12",A="BF:Luke,11:12"$ Jesus says, when you ask God for things, it is as annoying as like a neighbor in the night! $LK,"Luke,11:7",A="BF:Luke,11:7"$ He said, "I came to serve" but Jesus' three years of service were more like being a rockstar than a janitor. $LK,"John,13:14",A="BF:John,13:14"$
|
Jesus repeats the phrase, "for those who have ears to hear" many times, but not actually at the times that matter. Jesus says several Jedi mind tricks -- He asks, what father gives a scorpion to his son? $LK,"Luke,11:11-13",A="BF:Luke,11:11-13"$ Jesus says, when you ask God for things, it is as annoying as like a neighbor in the night! $LK,"Luke,11:5-7",A="BF:Luke,11:5-7"$ He said, "I came to serve" but Jesus' three years of service were more like being a rockstar than a janitor. $LK,"John,13:5-15",A="BF:John,13:5-15"$
|
||||||
|
|
||||||
There are sheep and there are shepherds. You would be silly to take other shepherds seriously when they are only caring for their sheep. Sheep are very hard to communicate to, as Jesus learned. He used parables. Seed on a path gets eaten by birds; weeds choke; and the one percent is rich soil.
|
There are sheep and there are shepherds. You would be silly to take other shepherds seriously when they are only caring for their sheep. Sheep are very hard to communicate to, as Jesus learned. He used parables. Seed on a path gets eaten by birds; weeds choke; and the one percent is rich soil.
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ War? $FG,4$"Servicemen competing"$FG$
|
|||||||
(Praise the Creator--what would teenage male video games be like if never war?)
|
(Praise the Creator--what would teenage male video games be like if never war?)
|
||||||
|
|
||||||
Is the World perfectly just? $FG,4$Are you calling me lazy?$FG$
|
Is the World perfectly just? $FG,4$Are you calling me lazy?$FG$
|
||||||
(Slavery was just. In the movie, Titanic, the rich wore straight jackets. You must bow to authority to get authority. I do $TX,"Moses comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/"$ as offerings. I said, "We're dying of malnutrician on manna." Like Cain and Abel, God didn't like it. Duh! He wants to be the hero. How do I know they died of malnutrician? Screw Hollywood for making slavery worse than it was -- I love God. School is more cruel. Read $LK,"Numbers,11:1",A="BF:Numbers,11:1"$. All you need is food, clothing and the word of God. Today, you can take Ivy League course videos! There is no excuse except you were born stupid... or ugly. I'm gonna praise God.)
|
(Slavery was just. In the movie, Titanic, the rich wore straight jackets. You must bow to authority to get authority. I do $TX,"Moses comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/"$ as offerings. I said, "We're dying of malnutrician on manna." Like Cain and Abel, God didn't like it. Duh! He wants to be the hero. How do I know they died of malnutrician? Screw Hollywood for making slavery worse than it was -- I love God. School is more cruel. Read $LK,"Numbers,11:1-35",A="BF:Numbers,11:1-35"$. All you need is food, clothing and the word of God. Today, you can take Ivy League course videos! There is no excuse except you were born stupid... or ugly. I'm gonna praise God.)
|
||||||
|
|
||||||
On using Markov chains? $FG,4$"No weights"$FG$
|
On using Markov chains? $FG,4$"No weights"$FG$
|
||||||
On doing offerings? $FG,4$"Honest measures"(You get out what you put in.)
|
On doing offerings? $FG,4$"Honest measures"(You get out what you put in.)
|
||||||
@@ -93,7 +93,7 @@ Money? $FG,4$"Enough vehemently better"$FG$
|
|||||||
$FG,4$"Pride [or] money, choose_one"$FG$
|
$FG,4$"Pride [or] money, choose_one"$FG$
|
||||||
Favorite car? $FG,4$Beamer$FG$
|
Favorite car? $FG,4$Beamer$FG$
|
||||||
Favorite soda? $FG,4$Root beer, $TX,"scotch variety",HTML="http://www.root-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$
|
Favorite soda? $FG,4$Root beer, $TX,"scotch variety",HTML="http://www.root-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$
|
||||||
Homosexuality? $LK,"Matthew,15:10",A="BF:Matthew,15:10",HTML="http://www.biblegateway.com/passage/?search=matthew%2015:10-11&version=NIV"$
|
Homosexuality? $LK,"Matthew,15:11",A="BF:Matthew,15:11"$
|
||||||
Pets? $FG,4$"homo"$FG$
|
Pets? $FG,4$"homo"$FG$
|
||||||
Sports? $FG,4$"homo"$FG$
|
Sports? $FG,4$"homo"$FG$
|
||||||
Favorite sport? $FG,4$Hockey$FG$
|
Favorite sport? $FG,4$Hockey$FG$
|
||||||
|
|||||||
+1
-1
@@ -153,7 +153,7 @@ public class CSpritePtMeshU8s : CSpriteBase
|
|||||||
public class CSprite
|
public class CSprite
|
||||||
{
|
{
|
||||||
CSprite *next,*last;
|
CSprite *next,*last;
|
||||||
Bool selected;
|
Bool sel;
|
||||||
U0 start;
|
U0 start;
|
||||||
union {
|
union {
|
||||||
U8 type;
|
U8 type;
|
||||||
|
|||||||
+2
-2
@@ -9,7 +9,7 @@ _GR_UPDATE_LINE64::
|
|||||||
|
|
||||||
MOV RAX,U64 SF_ARG2[RBP]
|
MOV RAX,U64 SF_ARG2[RBP]
|
||||||
MOV RSI,U64 [RAX] //rsi=src
|
MOV RSI,U64 [RAX] //rsi=src
|
||||||
MOV RBX,U64 [&reverse_bits_table]
|
MOV RBX,U64 [&rev_bits_table]
|
||||||
MOV RCX,U64 SF_ARG3[RBP] //rcx=d
|
MOV RCX,U64 SF_ARG3[RBP] //rcx=d
|
||||||
MOV RAX,U64 SF_ARG4[RBP]
|
MOV RAX,U64 SF_ARG4[RBP]
|
||||||
MOV RDI,U64 [RAX] //rdi=image
|
MOV RDI,U64 [RAX] //rdi=image
|
||||||
@@ -62,7 +62,7 @@ _GR_UPDATE_LINE64_FLUSH_CACHE::
|
|||||||
|
|
||||||
MOV RAX,U64 SF_ARG2[RBP]
|
MOV RAX,U64 SF_ARG2[RBP]
|
||||||
MOV RSI,U64 [RAX] //rsi=src
|
MOV RSI,U64 [RAX] //rsi=src
|
||||||
MOV RBX,U64 [&reverse_bits_table]
|
MOV RBX,U64 [&rev_bits_table]
|
||||||
MOV RCX,U64 SF_ARG3[RBP] //rcx=d
|
MOV RCX,U64 SF_ARG3[RBP] //rcx=d
|
||||||
MOV RAX,U64 SF_ARG4[RBP]
|
MOV RAX,U64 SF_ARG4[RBP]
|
||||||
MOV RDI,U64 [RAX] //rdi=image
|
MOV RDI,U64 [RAX] //rdi=image
|
||||||
|
|||||||
@@ -1808,3 +1808,174 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
|||||||
gr_done:
|
gr_done:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||||
|
{//3D. No transformation or pen width.
|
||||||
|
//Returns cnt of pixs changed
|
||||||
|
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||||
|
I64 dist,dy,dz,z,res=0,i,j,d;
|
||||||
|
U8 *dst;
|
||||||
|
CColorROPU32 c,c2,color=dc->color,bkcolor=dc->bkcolor,dither_colors;
|
||||||
|
I32 *db;
|
||||||
|
Bool plot=TRUE,char_clear,dither,probability_dither;
|
||||||
|
CTask *win_task;
|
||||||
|
|
||||||
|
if (!dc->depth_buf) {
|
||||||
|
if (y2<y1) SwapI64(&y1,&y2);
|
||||||
|
return GrRect(dc,x,y1,1,y2-y1+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||||
|
win_task=dc->win_task;
|
||||||
|
x +=win_task->scroll_x;
|
||||||
|
y1+=win_task->scroll_y;
|
||||||
|
y2+=win_task->scroll_y;
|
||||||
|
z1+=win_task->scroll_z;
|
||||||
|
z2+=win_task->scroll_z;
|
||||||
|
}
|
||||||
|
if (dc->flags & DCF_RECORD_EXTENTS) {
|
||||||
|
if (x<dc->min_x) dc->min_x=x;
|
||||||
|
if (x>dc->max_x) dc->max_x=x;
|
||||||
|
if (y1<dc->min_y) dc->min_y=y1;
|
||||||
|
if (y1>dc->max_y) dc->max_y=y1;
|
||||||
|
if (y2<dc->min_y) dc->min_y=y2;
|
||||||
|
if (y2>dc->max_y) dc->max_y=y2;
|
||||||
|
}
|
||||||
|
if (x<0) goto gr_done;
|
||||||
|
if (y2<y1) {
|
||||||
|
SwapI64(&y1,&y2);
|
||||||
|
SwapI64(&z1,&z2);
|
||||||
|
}
|
||||||
|
if (y2<0)
|
||||||
|
goto gr_done;
|
||||||
|
if (y1<0) {
|
||||||
|
i=-y1;
|
||||||
|
y1=0;
|
||||||
|
} else
|
||||||
|
i=0;
|
||||||
|
j=0;
|
||||||
|
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||||
|
y1+=win_task->pix_top;
|
||||||
|
y2+=win_task->pix_top;
|
||||||
|
if (y1>win_task->pix_bottom)
|
||||||
|
goto gr_done;
|
||||||
|
if (y2>win_task->pix_bottom) {
|
||||||
|
j=y2-win_task->pix_bottom;
|
||||||
|
y2=win_task->pix_bottom;
|
||||||
|
}
|
||||||
|
x+=win_task->pix_left;
|
||||||
|
if (!(0<=x<=win_task->pix_right) || y2<0)
|
||||||
|
goto gr_done;
|
||||||
|
}
|
||||||
|
if (y1>=dc->height || x>=dc->width)
|
||||||
|
goto gr_done;
|
||||||
|
dy=y2+j-(y1-i);
|
||||||
|
d=dc->width_internal*y1+x;
|
||||||
|
if (db=dc->depth_buf) {
|
||||||
|
db+=d;
|
||||||
|
if (dy)
|
||||||
|
dz=(z2-z1)<<32/dy;
|
||||||
|
else
|
||||||
|
dz=0;
|
||||||
|
z=z1<<32;
|
||||||
|
}
|
||||||
|
if (i)
|
||||||
|
z+=i*dz;
|
||||||
|
if (y2>=dc->height)
|
||||||
|
y2=dc->height-1;
|
||||||
|
|
||||||
|
if (dc->flags & DCF_LOCATE_NEAREST) {
|
||||||
|
if (y1<=dc->cur_y<=y2)
|
||||||
|
dist=0;
|
||||||
|
else if (dc->cur_y<y1)
|
||||||
|
dist=SqrI64(y1-dc->cur_y);
|
||||||
|
else
|
||||||
|
dist=SqrI64(dc->cur_y-y2);
|
||||||
|
dist+=SqrI64(x-dc->cur_x);
|
||||||
|
if (dist<=dc->nearest_dist) {
|
||||||
|
dc->nearest_dist=dist;
|
||||||
|
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dc->flags & DCF_DONT_DRAW)
|
||||||
|
goto gr_done;
|
||||||
|
|
||||||
|
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
||||||
|
win_task->next_task==sys_winmgr_task ||
|
||||||
|
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||||
|
char_clear=TRUE;
|
||||||
|
else
|
||||||
|
char_clear=FALSE;
|
||||||
|
if (color.c1.rop&(ROPBF_DITHER|ROPBF_PROBABILITY_DITHER)) {
|
||||||
|
dither=TRUE;
|
||||||
|
if (color.c1.rop&ROPBF_PROBABILITY_DITHER) {
|
||||||
|
probability_dither=TRUE;
|
||||||
|
color.c1.rop=color.c0.rop;
|
||||||
|
dither_colors=color;
|
||||||
|
if (RandU16<dc->dither_probability_u16)
|
||||||
|
color.c0=dither_colors.c1;
|
||||||
|
else
|
||||||
|
color.c0=dither_colors.c0;
|
||||||
|
} else {
|
||||||
|
probability_dither=FALSE;
|
||||||
|
color.c1.rop=color.c0.rop;
|
||||||
|
if ((x^y1)&1)
|
||||||
|
SwapU16(&color.c0,&color.c1);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
dither=FALSE;
|
||||||
|
while (y1<=y2) {
|
||||||
|
if (char_clear) {
|
||||||
|
if (db) {
|
||||||
|
if (0<=z.i32[1]<=*db) {
|
||||||
|
*db=z.i32[1];
|
||||||
|
plot=TRUE;
|
||||||
|
} else
|
||||||
|
plot=FALSE;
|
||||||
|
}
|
||||||
|
if (plot) {
|
||||||
|
dst=dc->body+d;
|
||||||
|
c=color.c0.color;
|
||||||
|
switch [color.c0.rop] {
|
||||||
|
case ROPB_EQU:
|
||||||
|
case ROPB_MONO:
|
||||||
|
*dst=c;
|
||||||
|
break;
|
||||||
|
case ROPB_COLLISION:
|
||||||
|
c2=*dst;
|
||||||
|
if (c2!=TRANSPARENT && c2!=bkcolor.c0.color)
|
||||||
|
dc->collision_cnt++;
|
||||||
|
break;
|
||||||
|
case ROPB_XOR:
|
||||||
|
*dst^=c;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
res++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dither) {
|
||||||
|
if (probability_dither) {
|
||||||
|
if (RandU16<dc->dither_probability_u16)
|
||||||
|
color.c0=dither_colors.c1;
|
||||||
|
else
|
||||||
|
color.c0=dither_colors.c0;
|
||||||
|
} else
|
||||||
|
SwapU16(&color.c0,&color.c1);
|
||||||
|
}
|
||||||
|
d+=dc->width_internal;
|
||||||
|
y1++;
|
||||||
|
if (db)
|
||||||
|
db+=dc->width_internal;
|
||||||
|
z+=dz;
|
||||||
|
if (!(y1&(FONT_HEIGHT-1)) && y1<=y2) {
|
||||||
|
if (!(dc->flags & DCF_SCREEN_BITMAP)||
|
||||||
|
win_task->next_task==sys_winmgr_task ||
|
||||||
|
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||||
|
char_clear=TRUE;
|
||||||
|
else
|
||||||
|
char_clear=FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gr_done:
|
||||||
|
return res;
|
||||||
|
}
|
||||||
@@ -30,6 +30,8 @@ public class CGrGlbls
|
|||||||
*collision_pen_brushes[GR_NUM_PEN_BRUSHES],
|
*collision_pen_brushes[GR_NUM_PEN_BRUSHES],
|
||||||
*even_pen_brushes[GR_NUM_PEN_BRUSHES],
|
*even_pen_brushes[GR_NUM_PEN_BRUSHES],
|
||||||
*odd_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_SCREEN_ZOOM 8
|
#define GR_MAX_SCREEN_ZOOM 8
|
||||||
U8 *screen_zoom_tables[GR_MAX_SCREEN_ZOOM+1];
|
U8 *screen_zoom_tables[GR_MAX_SCREEN_ZOOM+1];
|
||||||
|
|||||||
+12
-1
@@ -20,6 +20,17 @@ U0 GrSetUpTables()
|
|||||||
|
|
||||||
for (i=0;i<GR_NUM_PEN_BRUSHES;i++) {
|
for (i=0;i<GR_NUM_PEN_BRUSHES;i++) {
|
||||||
k=i+1;
|
k=i+1;
|
||||||
|
|
||||||
|
rr=k*k;
|
||||||
|
for (y=1;y<k;y++)
|
||||||
|
for (x=1;x<k;x++)
|
||||||
|
if (SqrI64(y*2-k)+SqrI64(x*2-k)<rr) {
|
||||||
|
if (x-1-i>>1<gr.circle_lo[i][i-y])
|
||||||
|
gr.circle_lo[i][i-y]=x-1-i>>1;
|
||||||
|
if (x-1-i>>1>gr.circle_hi[i][i-y])
|
||||||
|
gr.circle_hi[i][i-y]=x-1-i>>1;
|
||||||
|
}
|
||||||
|
|
||||||
dc=DCNew(i,i);
|
dc=DCNew(i,i);
|
||||||
gr.pen_brushes[i]=dc;
|
gr.pen_brushes[i]=dc;
|
||||||
dc->color=COLOR_MONO;
|
dc->color=COLOR_MONO;
|
||||||
@@ -57,7 +68,7 @@ U0 GrSetUpTables()
|
|||||||
GrPlot0(dc,x-1,y-1);
|
GrPlot0(dc,x-1,y-1);
|
||||||
}
|
}
|
||||||
if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode
|
if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode
|
||||||
MemSet(VGAM_TEXT,0,TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
MemSet(text.vga_text_alias,0,TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
||||||
MemSet(gr.vga_text_cache,0,TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
MemSet(gr.vga_text_cache,0,TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
||||||
} else {
|
} else {
|
||||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||||
|
|||||||
+12
-31
@@ -5,11 +5,8 @@ public I64 gr_x_offsets[8]={-1, 0, 1,-1,1,-1,0,1},
|
|||||||
gr_x_offsets2[4]={ 0,-1, 1, 0},
|
gr_x_offsets2[4]={ 0,-1, 1, 0},
|
||||||
gr_y_offsets2[4]={-1, 0, 0, 1};
|
gr_y_offsets2[4]={-1, 0, 0, 1};
|
||||||
|
|
||||||
public Bool Line(U8 *aux_data,
|
public Bool Line(U8 *aux_data,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
||||||
I64 x1,I64 y1,I64 z1,
|
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),I64 step=1,I64 start=0)
|
||||||
I64 x2,I64 y2,I64 z2,
|
|
||||||
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
|
||||||
I64 step=1,I64 start=0)
|
|
||||||
{//Step through line segment calling callback.
|
{//Step through line segment calling callback.
|
||||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||||
I64 i,j,d,dx=x2-x1,dy=y2-y1,dz=z2-z1,_x,_y,_z,
|
I64 i,j,d,dx=x2-x1,dy=y2-y1,dz=z2-z1,_x,_y,_z,
|
||||||
@@ -115,8 +112,7 @@ public I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL)
|
|||||||
|
|
||||||
public I64 *Mat4x4RotX(I64 *m1,F64 è)
|
public I64 *Mat4x4RotX(I64 *m1,F64 è)
|
||||||
{//Rot matrix about X axis. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
{//Rot matrix about X axis. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||||
F64 my_cos=Cos(è)*GR_SCALE,
|
F64 my_cos=Cos(è)*GR_SCALE,my_sin=Sin(è)*GR_SCALE;
|
||||||
my_sin=Sin(è)*GR_SCALE;
|
|
||||||
I64 r[16],r2[16];
|
I64 r[16],r2[16];
|
||||||
MemSet(r,0,sizeof(r));
|
MemSet(r,0,sizeof(r));
|
||||||
r[5]=my_cos;
|
r[5]=my_cos;
|
||||||
@@ -130,8 +126,7 @@ public I64 *Mat4x4RotX(I64 *m1,F64
|
|||||||
|
|
||||||
public I64 *Mat4x4RotY(I64 *m1,F64 ê)
|
public I64 *Mat4x4RotY(I64 *m1,F64 ê)
|
||||||
{//Rot matrix about Y axis. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
{//Rot matrix about Y axis. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||||
F64 my_cos=Cos(ê)*GR_SCALE,
|
F64 my_cos=Cos(ê)*GR_SCALE,my_sin=Sin(ê)*GR_SCALE;
|
||||||
my_sin=Sin(ê)*GR_SCALE;
|
|
||||||
I64 r[16],r2[16];
|
I64 r[16],r2[16];
|
||||||
MemSet(r,0,sizeof(r));
|
MemSet(r,0,sizeof(r));
|
||||||
r[0]=my_cos;
|
r[0]=my_cos;
|
||||||
@@ -145,8 +140,7 @@ public I64 *Mat4x4RotY(I64 *m1,F64
|
|||||||
|
|
||||||
public I64 *Mat4x4RotZ(I64 *m1,F64 é)
|
public I64 *Mat4x4RotZ(I64 *m1,F64 é)
|
||||||
{//Rot matrix about Z axis. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
{//Rot matrix about Z axis. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||||
F64 my_cos=Cos(é)*GR_SCALE,
|
F64 my_cos=Cos(é)*GR_SCALE,my_sin=Sin(é)*GR_SCALE;
|
||||||
my_sin=Sin(é)*GR_SCALE;
|
|
||||||
I64 r[16],r2[16];
|
I64 r[16],r2[16];
|
||||||
MemSet(r,0,sizeof(r));
|
MemSet(r,0,sizeof(r));
|
||||||
r[0]=my_cos;
|
r[0]=my_cos;
|
||||||
@@ -285,13 +279,9 @@ public U0 DCReflect(CDC *dc,I64 *_x,I64 *_y,I64 *_z)
|
|||||||
#help_index "Graphics/Math"
|
#help_index "Graphics/Math"
|
||||||
#define SCALE1 24
|
#define SCALE1 24
|
||||||
#define SCALE2 8
|
#define SCALE2 8
|
||||||
public Bool Circle(U8 *aux_data,
|
public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius,
|
||||||
I64 cx,I64 cy,I64 cz,
|
|
||||||
I64 radius,
|
|
||||||
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
||||||
I64 step=1,
|
I64 step=1,F64 start_radians=0,F64 len_radians=2*ã)
|
||||||
F64 start_radians=0,
|
|
||||||
F64 len_radians=2*ã)
|
|
||||||
{//Step through circle arc calling callback.
|
{//Step through circle arc calling callback.
|
||||||
I64 i,j,len=Ceil(len_radians*radius),
|
I64 i,j,len=Ceil(len_radians*radius),
|
||||||
x,y,x1,y1,s1,s2,c;
|
x,y,x1,y1,s1,s2,c;
|
||||||
@@ -328,14 +318,9 @@ public Bool Circle(U8 *aux_data,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bool Ellipse(U8 *aux_data,
|
public Bool Ellipse(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
||||||
I64 cx,I64 cy,I64 cz,
|
I64 x_radius,I64 y_radius,Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
||||||
I64 x_radius,I64 y_radius,
|
F64 rot_angle=0,I64 step=1,F64 start_radians=0,F64 len_radians=2*ã)
|
||||||
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
|
||||||
F64 rot_angle=0,
|
|
||||||
I64 step=1,
|
|
||||||
F64 start_radians=0,
|
|
||||||
F64 len_radians=2*ã)
|
|
||||||
{//Step through ellipse arc calling callback.
|
{//Step through ellipse arc calling callback.
|
||||||
I64 i,j,len,
|
I64 i,j,len,
|
||||||
x,y,_x,_y,x1,y1,x2,y2, s1,s2,c, s12,s22,c2;
|
x,y,_x,_y,x1,y1,x2,y2, s1,s2,c, s12,s22,c2;
|
||||||
@@ -400,14 +385,10 @@ public Bool Ellipse(U8 *aux_data,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bool RegPoly(U8 *aux_data,
|
public Bool RegPoly(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
||||||
I64 cx,I64 cy,I64 cz,
|
|
||||||
I64 x_radius,I64 y_radius,I64 sides,
|
I64 x_radius,I64 y_radius,I64 sides,
|
||||||
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
||||||
F64 rot_angle=0,
|
F64 rot_angle=0,I64 step=1,F64 start_radians=0,F64 len_radians=2*ã)
|
||||||
I64 step=1,
|
|
||||||
F64 start_radians=0,
|
|
||||||
F64 len_radians=2*ã)
|
|
||||||
{//Step through regular polygon calling callback.
|
{//Step through regular polygon calling callback.
|
||||||
I64 i,n,x,y,x1,y1,x2,y2,
|
I64 i,n,x,y,x1,y1,x2,y2,
|
||||||
xx1,yy1,xx2,yy2,
|
xx1,yy1,xx2,yy2,
|
||||||
|
|||||||
+272
-14
@@ -274,6 +274,141 @@ ff_done:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
I64 GrFillSemiCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter,I64 n)
|
||||||
|
{//2D. Clipping but not transformation.
|
||||||
|
I64 res=0,i,k,r=diameter>>1,rr;
|
||||||
|
if (diameter>=1)
|
||||||
|
switch (n) {
|
||||||
|
case 0:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=0;i<r;i++)
|
||||||
|
res+=GrHLine(dc,-Sqrt(rr-SqrI64(r-i))+cx,
|
||||||
|
Sqrt(rr-SqrI64(r-i))+cx,cy+i-r,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=r+1;i<k;i++)
|
||||||
|
res+=GrHLine(dc,-Sqrt(rr-SqrI64(i-r))+cx,
|
||||||
|
Sqrt(rr-SqrI64(i-r))+cx,cy+i-r,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=0;i<r;i++)
|
||||||
|
res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(r-i))+cy,
|
||||||
|
Sqrt(rr-SqrI64(r-i))+cy,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=r+1;i<k;i++)
|
||||||
|
res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(i-r))+cy,
|
||||||
|
Sqrt(rr-SqrI64(i-r))+cy,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=0;i<r;i++)
|
||||||
|
res+=GrHLine(dc,-Sqrt(rr-SqrI64(r-i))+cx,
|
||||||
|
Sqrt(rr-SqrI64(r-i))+cx,cy+i-r,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=r+1;i<k;i++)
|
||||||
|
res+=GrHLine(dc,-Sqrt(rr-SqrI64(i-r))+cx,
|
||||||
|
Sqrt(rr-SqrI64(i-r))+cx,cy+i-r,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=0;i<r;i++)
|
||||||
|
res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(r-i))+cy,
|
||||||
|
Sqrt(rr-SqrI64(r-i))+cy,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
if (diameter<GR_NUM_PEN_BRUSHES)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=r+1;i<k;i++)
|
||||||
|
res+=GrVLine(dc,cx+i-r,-Sqrt(rr-SqrI64(i-r))+cy,
|
||||||
|
Sqrt(rr-SqrI64(i-r))+cy,z,z);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
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);
|
||||||
|
else {
|
||||||
|
k=diameter+1;
|
||||||
|
rr=SqrI64((k+1)>>1);
|
||||||
|
for (i=0;i<=r;i++)
|
||||||
|
res+=GrHLine(dc,-Sqrt(rr-SqrI64(r-i))+cx,
|
||||||
|
Sqrt(rr-SqrI64(r-i))+cx,cy+i-r,z,z);
|
||||||
|
for (;i<k;i++)
|
||||||
|
res+=GrHLine(dc,-Sqrt(rr-SqrI64(i-r))+cx,
|
||||||
|
Sqrt(rr-SqrI64(i-r))+cx,cy+i-r,z,z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public Bool GrPlot3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
public Bool GrPlot3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||||
{//3D. Clipping and transformation but no pen_width.
|
{//3D. Clipping and transformation but no pen_width.
|
||||||
I64 _x,_y,_z;
|
I64 _x,_y,_z;
|
||||||
@@ -305,7 +440,7 @@ gr_done:
|
|||||||
|
|
||||||
public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||||
{//3D. Clipping and transformation and pen width.
|
{//3D. Clipping and transformation and pen width.
|
||||||
I64 _x,_y,_z,i,j,w,dist;
|
I64 _x,_y,_z,w,dist;
|
||||||
CColorROPU32 old_color=dc->color;
|
CColorROPU32 old_color=dc->color;
|
||||||
Bool record,was_transform=FALSE,was_symmetry=FALSE;
|
Bool record,was_transform=FALSE,was_symmetry=FALSE;
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
@@ -401,15 +536,8 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (dc->pen_width & 1) {//TODO Dither
|
} else
|
||||||
for (i=-w;i<=w;i++)
|
GrFillCircle(dc,x,y,dc->db_z,dc->pen_width);
|
||||||
for (j=-w;j<=w;j++)
|
|
||||||
GrPlot1(dc,x+i,y+j);
|
|
||||||
} else {
|
|
||||||
for (i=-w;i<w;i++)
|
|
||||||
for (j=-w;j<w;j++)
|
|
||||||
GrPlot1(dc,x+i,y+j);
|
|
||||||
}
|
|
||||||
gr_done:
|
gr_done:
|
||||||
dc->color=old_color;
|
dc->color=old_color;
|
||||||
if (was_transform)
|
if (was_transform)
|
||||||
@@ -519,6 +647,128 @@ public Bool Gr3BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
|
|||||||
return BSpline3(dc,ctrl,cnt,&GrLinePlot,closed);
|
return BSpline3(dc,ctrl,cnt,&GrLinePlot,closed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
I64 GrLineFat3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
||||||
|
I64 width,I64 start=0)
|
||||||
|
{//Step through line segment calling callback.
|
||||||
|
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
|
||||||
|
I64 res=0,i,j,d,dx=x2-x1,dy=y2-y1,dz=z2-z1,_x,_y,_z,d_lo,d_hi,
|
||||||
|
adx=AbsI64(dx),ady=AbsI64(dy),adz=AbsI64(dz);
|
||||||
|
if (width>0) {
|
||||||
|
if (adx>=ady) {
|
||||||
|
if (adx>=adz) {
|
||||||
|
if (d=adx) {
|
||||||
|
if (dx>=0)
|
||||||
|
dx=0x100000000;
|
||||||
|
else
|
||||||
|
dx=-0x100000000;
|
||||||
|
dy=dy<<32/d;
|
||||||
|
dz=dz<<32/d;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (d=adz) {
|
||||||
|
dx=dx<<32/d;
|
||||||
|
dy=dy<<32/d;
|
||||||
|
if (dz>=0)
|
||||||
|
dz=0x100000000;
|
||||||
|
else
|
||||||
|
dz=-0x100000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
x1<<=32; y1<<=32; z1<<=32;
|
||||||
|
for (j=0;j<start;j++) {
|
||||||
|
x1+=dx; y1+=dy; z1+=dz;
|
||||||
|
}
|
||||||
|
if (start>=d)
|
||||||
|
res+=GrFillCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width);
|
||||||
|
else {
|
||||||
|
if (width==1)
|
||||||
|
for (i=start;i<=d;i++) {
|
||||||
|
dc->db_z=z1.i32[1];
|
||||||
|
res+=GrPlot1(dc,x1.i32[1],y1.i32[1]);
|
||||||
|
_x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
|
||||||
|
x1+=dx; y1+=dy; z1+=dz;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
i=width*Sqrt(SqrI64(adx)+SqrI64(ady))/adx;
|
||||||
|
d_lo=i>>1; d_hi=(i-1)>>1;
|
||||||
|
|
||||||
|
if (dx>=0)
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,2);
|
||||||
|
else
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,7);
|
||||||
|
for (i=start;i<=d;i++) {
|
||||||
|
res+=GrVLine(dc,x1.i32[1],y1.i32[1]-d_lo,y1.i32[1]+d_hi,
|
||||||
|
z1.i32[1],z1.i32[1]);
|
||||||
|
_x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
|
||||||
|
x1+=dx; y1+=dy; z1+=dz;
|
||||||
|
}
|
||||||
|
x1-=dx; y1-=dy; z1-=dz;
|
||||||
|
if (dx>=0)
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,3);
|
||||||
|
else
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (ady>=adz) {
|
||||||
|
if (d=ady) {
|
||||||
|
dx=dx<<32/d;
|
||||||
|
if (dy>=0)
|
||||||
|
dy=0x100000000;
|
||||||
|
else
|
||||||
|
dy=-0x100000000;
|
||||||
|
dz=dz<<32/d;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (d=adz) {
|
||||||
|
dx=dx<<32/d;
|
||||||
|
dy=dy<<32/d;
|
||||||
|
if (dz>=0)
|
||||||
|
dz=0x100000000;
|
||||||
|
else
|
||||||
|
dz=-0x100000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
x1<<=32; y1<<=32; z1<<=32;
|
||||||
|
for (j=0;j<start;j++) {
|
||||||
|
x1+=dx; y1+=dy; z1+=dz;
|
||||||
|
}
|
||||||
|
if (start>=d)
|
||||||
|
res+=GrFillCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width);
|
||||||
|
else {
|
||||||
|
if (width==1)
|
||||||
|
for (i=start;i<=d;i++) {
|
||||||
|
dc->db_z=z1.i32[1];
|
||||||
|
res+=GrPlot1(dc,x1.i32[1],y1.i32[1]);
|
||||||
|
_x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
|
||||||
|
x1+=dx; y1+=dy; z1+=dz;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
i=width*Sqrt(SqrI64(ady)+SqrI64(adx))/ady;
|
||||||
|
d_lo=i>>1; d_hi=(i-1)>>1;
|
||||||
|
|
||||||
|
if (dy>=0)
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,0);
|
||||||
|
else
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,5);
|
||||||
|
for (i=start;i<=d;i++) {
|
||||||
|
res+=GrHLine(dc,x1.i32[1]-d_lo,x1.i32[1]+d_hi,y1.i32[1],
|
||||||
|
z1.i32[1],z1.i32[1]);
|
||||||
|
_x=x1.i32[1]; _y=y1.i32[1]; _z=z1.i32[1];
|
||||||
|
x1+=dx; y1+=dy; z1+=dz;
|
||||||
|
}
|
||||||
|
x1-=dx; y1-=dy; z1-=dz;
|
||||||
|
if (dy>=0)
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,1);
|
||||||
|
else
|
||||||
|
res+=GrFillSemiCircle(dc,x1.i32[1],y1.i32[1],z1.i32[1],width,4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
||||||
I64 step=1,I64 start=0)
|
I64 step=1,I64 start=0)
|
||||||
{//3D. Transformation with pen width.
|
{//3D. Transformation with pen width.
|
||||||
@@ -536,20 +786,28 @@ public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
|
|||||||
_x2=x2; _y2=y2; _z2=z2;
|
_x2=x2; _y2=y2; _z2=z2;
|
||||||
DCReflect(dc,&_x2,&_y2,&_z2);
|
DCReflect(dc,&_x2,&_y2,&_z2);
|
||||||
dc->flags&=~DCF_SYMMETRY;
|
dc->flags&=~DCF_SYMMETRY;
|
||||||
if (step==1 && !start && !dc->brush && dc->pen_width<2 &&
|
if (step==1 && !dc->brush) {
|
||||||
!dc->depth_buf) {//TODO: clip z for depth buf
|
if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf
|
||||||
if (DCClipLine(dc,&_x1,&_y1,&_x2,&_y2))
|
if (DCClipLine(dc,&_x1,&_y1,&_x2,&_y2))
|
||||||
res=Line(dc,_x1,_y1,0,_x2,_y2,0,&GrLinePlot0,step,start);
|
res=Line(dc,_x1,_y1,0,_x2,_y2,0,&GrLinePlot0,step,start);
|
||||||
|
} else {
|
||||||
|
if (GrLineFat3(dc,_x1,_y1,_z1,_x2,_y2,_z2,dc->pen_width,start))
|
||||||
|
res=TRUE;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start);
|
res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start);
|
||||||
was_symmetry=TRUE;
|
was_symmetry=TRUE;
|
||||||
if (dc->flags&DCF_JUST_MIRROR)
|
if (dc->flags&DCF_JUST_MIRROR)
|
||||||
goto gr_done;
|
goto gr_done;
|
||||||
}
|
}
|
||||||
if (step==1 && !start && !dc->brush && dc->pen_width<2 &&
|
if (step==1 && !dc->brush) {
|
||||||
!dc->depth_buf) {//TODO: clip z for depth buf
|
if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf
|
||||||
if (DCClipLine(dc,&x1,&y1,&x2,&y2))
|
if (DCClipLine(dc,&x1,&y1,&x2,&y2))
|
||||||
res|=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start);
|
res|=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start);
|
||||||
|
} else {
|
||||||
|
if (GrLineFat3(dc,x1,y1,z1,x2,y2,z2,dc->pen_width,start))
|
||||||
|
res=TRUE;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start);
|
res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start);
|
||||||
gr_done:
|
gr_done:
|
||||||
|
|||||||
+11
-14
@@ -221,8 +221,8 @@ U0 GrUpdateTextBG()
|
|||||||
for (row=num_rows;row--;) {
|
for (row=num_rows;row--;) {
|
||||||
for (col=num_cols;col--;) {
|
for (col=num_cols;col--;) {
|
||||||
cur_ch=*src++;
|
cur_ch=*src++;
|
||||||
if (cur_ch & (ATTRF_SELECTED|ATTRF_INVERT|ATTRF_BLINK)) {
|
if (cur_ch & (ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) {
|
||||||
if (cur_ch & ATTRF_SELECTED)
|
if (cur_ch & ATTRF_SEL)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
||||||
if (cur_ch & ATTRF_INVERT)
|
if (cur_ch & ATTRF_INVERT)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
||||||
@@ -286,8 +286,8 @@ U0 GrUpdateTextFG()
|
|||||||
for (row=num_rows;row--;) {
|
for (row=num_rows;row--;) {
|
||||||
for (col=num_cols;col--;) {
|
for (col=num_cols;col--;) {
|
||||||
cur_ch=*src++;
|
cur_ch=*src++;
|
||||||
if (cur_ch & (ATTRF_UNDERLINE|ATTRF_SELECTED|ATTRF_INVERT|ATTRF_BLINK)) {
|
if (cur_ch & (ATTRF_UNDERLINE|ATTRF_SEL|ATTRF_INVERT|ATTRF_BLINK)) {
|
||||||
if (cur_ch & ATTRF_SELECTED)
|
if (cur_ch & ATTRF_SEL)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
||||||
if (cur_ch & ATTRF_INVERT)
|
if (cur_ch & ATTRF_INVERT)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
||||||
@@ -327,34 +327,31 @@ U0 DCBlotColor8(CDC *dc,CDC *img)
|
|||||||
U0 GrUpdateTextModeText()
|
U0 GrUpdateTextModeText()
|
||||||
{
|
{
|
||||||
U32 *src=gr.text_base;
|
U32 *src=gr.text_base;
|
||||||
I64 cur_ch,i,d0=TEXT_COLS*TEXT_ROWS;
|
I64 cur_ch,i=TEXT_COLS*TEXT_ROWS;
|
||||||
U16 *dst=VGAM_TEXT,*dst2=gr.vga_text_cache;
|
U16 *dst=text.vga_text_alias,*dst2=gr.vga_text_cache;
|
||||||
Bool blink_flag=Blink;
|
Bool blink_flag=Blink;
|
||||||
if (LBtr(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0)) {
|
if (LBtr(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0)) {
|
||||||
i=d0;
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
cur_ch=*src++;
|
cur_ch=*src++;
|
||||||
if (cur_ch & ATTRF_SELECTED)
|
if (cur_ch & ATTRF_SEL)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
||||||
if (cur_ch & ATTRF_INVERT)
|
if (cur_ch & ATTRF_INVERT)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
||||||
if (cur_ch & ATTRF_BLINK)
|
if (cur_ch & ATTRF_BLINK)
|
||||||
if (blink_flag)
|
if (blink_flag)
|
||||||
cur_ch.u8[1]= cur_ch.u8[1]<<4+ cur_ch.u8[1]>>4;
|
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
||||||
cur_ch&=0x7FFF;
|
*dst++=*dst2++=cur_ch&0x7FFF;
|
||||||
*dst++=*dst2++=cur_ch;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
i=d0;
|
|
||||||
while (i--) {
|
while (i--) {
|
||||||
cur_ch=*src++;
|
cur_ch=*src++;
|
||||||
if (cur_ch & ATTRF_SELECTED)
|
if (cur_ch & ATTRF_SEL)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
cur_ch.u8[1]=cur_ch.u8[1]^0xFF;
|
||||||
if (cur_ch & ATTRF_INVERT)
|
if (cur_ch & ATTRF_INVERT)
|
||||||
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
||||||
if (cur_ch & ATTRF_BLINK)
|
if (cur_ch & ATTRF_BLINK)
|
||||||
if (blink_flag)
|
if (blink_flag)
|
||||||
cur_ch.u8[1]= cur_ch.u8[1]<<4+ cur_ch.u8[1]>>4;
|
cur_ch.u8[1]=cur_ch.u8[1]<<4+cur_ch.u8[1]>>4;
|
||||||
cur_ch&=0x7FFF;
|
cur_ch&=0x7FFF;
|
||||||
if (*dst2!=cur_ch)
|
if (*dst2!=cur_ch)
|
||||||
*dst++=*dst2++=cur_ch;
|
*dst++=*dst2++=cur_ch;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
|||||||
GrPlot3(dc,x1+x,y1+y,z);
|
GrPlot3(dc,x1+x,y1+y,z);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
sub_switch_start:
|
start:
|
||||||
p=&tempg->nu.u;
|
p=&tempg->nu.u;
|
||||||
for (i=0;i<tempg->nu.num;i++,p++) {
|
for (i=0;i<tempg->nu.num;i++,p++) {
|
||||||
p->x+=x;
|
p->x+=x;
|
||||||
@@ -191,7 +191,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
|||||||
case SPT_BSPLINE3_CLOSED:
|
case SPT_BSPLINE3_CLOSED:
|
||||||
Gr3BSpline3(dc,&tempg->nu.u,tempg->nu.num,TRUE);
|
Gr3BSpline3(dc,&tempg->nu.u,tempg->nu.num,TRUE);
|
||||||
break;
|
break;
|
||||||
sub_switch_end:
|
end:
|
||||||
p=&tempg->nu.u;
|
p=&tempg->nu.u;
|
||||||
for (i=0;i<tempg->nu.num;i++,p++) {
|
for (i=0;i<tempg->nu.num;i++,p++) {
|
||||||
p->x-=x;
|
p->x-=x;
|
||||||
|
|||||||
+8
-23
@@ -334,32 +334,17 @@ public U0 TextBorder(CTask *task=NULL,
|
|||||||
I64 i;
|
I64 i;
|
||||||
if (!task) task=Fs;
|
if (!task) task=Fs;
|
||||||
attr<<=8;
|
attr<<=8;
|
||||||
if (solid) {
|
TextChar(task,,l-1,t-1,text.border_chars[6+solid]+attr);
|
||||||
TextChar(task,,l-1,t-1,'É'+attr);
|
TextChar(task,,r+1,t-1,text.border_chars[8+solid]+attr);
|
||||||
TextChar(task,,r+1,t-1,'»'+attr);
|
TextChar(task,,l-1,b+1,text.border_chars[10+solid]+attr);
|
||||||
TextChar(task,,l-1,b+1,'È'+attr);
|
TextChar(task,,r+1,b+1,text.border_chars[12+solid]+attr);
|
||||||
TextChar(task,,r+1,b+1,'¼'+attr);
|
|
||||||
for (i=l;i<=r;i++) {
|
for (i=l;i<=r;i++) {
|
||||||
TextChar(task,,i,t-1,'Í'+attr);
|
TextChar(task,,i,t-1,text.border_chars[2+solid]+attr);
|
||||||
TextChar(task,,i,b+1,'Í'+attr);
|
TextChar(task,,i,b+1,text.border_chars[2+solid]+attr);
|
||||||
}
|
}
|
||||||
for (i=t;i<=b;i++) {
|
for (i=t;i<=b;i++) {
|
||||||
TextChar(task,,l-1,i,'º'+attr); //Note: $LK,"RawDr",A="MN:RawDr"$() uses this char.
|
TextChar(task,,l-1,i,text.border_chars[4+solid]+attr);
|
||||||
TextChar(task,,r+1,i,'º'+attr);
|
TextChar(task,,r+1,i,text.border_chars[4+solid]+attr);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
TextChar(task,,l-1,t-1,'Ú'+attr);
|
|
||||||
TextChar(task,,r+1,t-1,'¿'+attr);
|
|
||||||
TextChar(task,,l-1,b+1,'À'+attr);
|
|
||||||
TextChar(task,,r+1,b+1,'Ù'+attr);
|
|
||||||
for (i=l;i<=r;i++) {
|
|
||||||
TextChar(task,,i,t-1,'Ä'+attr);
|
|
||||||
TextChar(task,,i,b+1,'Ä'+attr);
|
|
||||||
}
|
|
||||||
for (i=t;i<=b;i++) {
|
|
||||||
TextChar(task,,l-1,i,'³'+attr);
|
|
||||||
TextChar(task,,r+1,i,'³'+attr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -361,7 +361,7 @@ bm_menu:
|
|||||||
GrPlot3(img,a1-xx1,a2-yy1,0);
|
GrPlot3(img,a1-xx1,a2-yy1,0);
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
break;
|
break;
|
||||||
sub_switch_start:
|
start:
|
||||||
if (down)
|
if (down)
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
x1=a1; y1=a2;
|
x1=a1; y1=a2;
|
||||||
@@ -386,7 +386,7 @@ bm_menu:
|
|||||||
dc->pen_width=1;
|
dc->pen_width=1;
|
||||||
GrBorder(dc,x1,y1,x1,y1);
|
GrBorder(dc,x1,y1,x1,y1);
|
||||||
break;
|
break;
|
||||||
sub_switch_end:
|
end:
|
||||||
break;
|
break;
|
||||||
case GBM_PASTE:
|
case GBM_PASTE:
|
||||||
case GBM_PASTE_TRANSPARENT:
|
case GBM_PASTE_TRANSPARENT:
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
CQueVectU8 *tempv;
|
CQueVectU8 *tempv;
|
||||||
MemSet(&g,0,sizeof(CSprite));
|
MemSet(&g,0,sizeof(CSprite));
|
||||||
switch (type) {
|
switch (type) {
|
||||||
sub_switch_start:
|
start:
|
||||||
case SPT_COLOR:
|
case SPT_COLOR:
|
||||||
case SPT_DITHER_COLOR:
|
case SPT_DITHER_COLOR:
|
||||||
st=LexFirstRem(cc,"}");
|
st=LexFirstRem(cc,"}");
|
||||||
@@ -311,7 +311,7 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
g.pwha.angle=ã/180*LexExpressionF64(cc);
|
g.pwha.angle=ã/180*LexExpressionF64(cc);
|
||||||
break;
|
break;
|
||||||
sub_switch_end:
|
end:
|
||||||
size=SpriteElemSize(&g)+offset(CSprite.start);
|
size=SpriteElemSize(&g)+offset(CSprite.start);
|
||||||
res=MAlloc(size);
|
res=MAlloc(size);
|
||||||
MemCpy(res,&g,size);
|
MemCpy(res,&g,size);
|
||||||
|
|||||||
+52
-52
@@ -69,7 +69,7 @@ CSprite *Sprite2SpriteQue(U8 *elems)
|
|||||||
tempg1=MAlloc(SpriteElemSize(tempg)+offset(CSprite.start));
|
tempg1=MAlloc(SpriteElemSize(tempg)+offset(CSprite.start));
|
||||||
s=SpriteElemSize(tempg);
|
s=SpriteElemSize(tempg);
|
||||||
MemCpy(&tempg1->start,&tempg->start,s);
|
MemCpy(&tempg1->start,&tempg->start,s);
|
||||||
tempg1->selected=FALSE;
|
tempg1->sel=FALSE;
|
||||||
QueIns(tempg1,res->last);
|
QueIns(tempg1,res->last);
|
||||||
tempg(U8 *)+=s;
|
tempg(U8 *)+=s;
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ U0 SpriteSetOrigin(CSprite *root,I64 dx,I64 dy,I64 dz)
|
|||||||
CD3I32 *p;
|
CD3I32 *p;
|
||||||
CSprite *tempg=root->next;
|
CSprite *tempg=root->next;
|
||||||
while (tempg!=root) {
|
while (tempg!=root) {
|
||||||
if (tempg->selected)
|
if (tempg->sel)
|
||||||
switch (tempg->type) {
|
switch (tempg->type) {
|
||||||
case SPT_ARROW:
|
case SPT_ARROW:
|
||||||
case SPT_LINE:
|
case SPT_LINE:
|
||||||
@@ -203,7 +203,7 @@ CSprite *SpriteTransformCircle(I64 *r,CSprite *tempg)
|
|||||||
tempg1->pwha.height=ToI64(m2)/0x10000;
|
tempg1->pwha.height=ToI64(m2)/0x10000;
|
||||||
tempg1->pwha.angle=-a1;
|
tempg1->pwha.angle=-a1;
|
||||||
|
|
||||||
tempg1->selected=tempg->selected;
|
tempg1->sel=tempg->sel;
|
||||||
return tempg1;
|
return tempg1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ CSprite *SpriteTransformEllipse(I64 *r,CSprite *tempg)
|
|||||||
if (tempg1->pwha.height<1) tempg1->pwha.height=1;
|
if (tempg1->pwha.height<1) tempg1->pwha.height=1;
|
||||||
tempg1->pwha.angle=-a1;
|
tempg1->pwha.angle=-a1;
|
||||||
|
|
||||||
tempg1->selected=tempg->selected;
|
tempg1->sel=tempg->sel;
|
||||||
return tempg1;
|
return tempg1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ CSprite *SpriteTransformRect(I64 *r,CSprite *tempg,F64
|
|||||||
tempg1->ppa.y2=tempg1->ppa.y1+h;
|
tempg1->ppa.y2=tempg1->ppa.y1+h;
|
||||||
tempg1->ppa.angle=-a1;
|
tempg1->ppa.angle=-a1;
|
||||||
|
|
||||||
tempg1->selected=tempg->selected;
|
tempg1->sel=tempg->sel;
|
||||||
return tempg1;
|
return tempg1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
|||||||
CD3I32 *p;
|
CD3I32 *p;
|
||||||
CSprite *tempg=root->next,root2,*tempg1,*tempg2,*tempg3;
|
CSprite *tempg=root->next,root2,*tempg1,*tempg2,*tempg3;
|
||||||
while (tempg!=root) {
|
while (tempg!=root) {
|
||||||
if (tempg->selected)
|
if (tempg->sel)
|
||||||
switch (tempg->type) {
|
switch (tempg->type) {
|
||||||
case SPT_WIDTH:
|
case SPT_WIDTH:
|
||||||
tempg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536;
|
tempg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536;
|
||||||
@@ -506,7 +506,7 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
|||||||
tempg3->npu.num=num;
|
tempg3->npu.num=num;
|
||||||
QueIns(tempg3,tempg);
|
QueIns(tempg3,tempg);
|
||||||
QueRem(tempg);
|
QueRem(tempg);
|
||||||
tempg3->selected=tempg->selected;
|
tempg3->sel=tempg->sel;
|
||||||
Free(tempg);
|
Free(tempg);
|
||||||
tempg=tempg3;
|
tempg=tempg3;
|
||||||
break;
|
break;
|
||||||
@@ -553,25 +553,25 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 SpriteQueSelectCnt(CSprite *root,Bool val=TRUE)
|
I64 SpriteQueSelCnt(CSprite *root,Bool val=TRUE)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
CSprite *tempg=root->next;
|
CSprite *tempg=root->next;
|
||||||
val=ToBool(val);
|
val=ToBool(val);
|
||||||
while (tempg!=root) {
|
while (tempg!=root) {
|
||||||
if (ToBool(tempg->selected)==val)
|
if (ToBool(tempg->sel)==val)
|
||||||
res++;
|
res++;
|
||||||
tempg=tempg->next;
|
tempg=tempg->next;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 SpriteQueSelectAll(CSprite *root,Bool val=TRUE)
|
I64 SpriteQueSelAll(CSprite *root,Bool val=TRUE)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
CSprite *tempg=root->next;
|
CSprite *tempg=root->next;
|
||||||
while (tempg!=root) {
|
while (tempg!=root) {
|
||||||
tempg->selected=val;
|
tempg->sel=val;
|
||||||
res++;
|
res++;
|
||||||
tempg=tempg->next;
|
tempg=tempg->next;
|
||||||
}
|
}
|
||||||
@@ -590,7 +590,7 @@ CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *root,I64 *_cur_elem_num)
|
|||||||
tempg=SpriteSetSettings(,root,doc_e->left_exp);
|
tempg=SpriteSetSettings(,root,doc_e->left_exp);
|
||||||
if (tempg!=root) {
|
if (tempg!=root) {
|
||||||
tempg=MAllocIdent(tempg);
|
tempg=MAllocIdent(tempg);
|
||||||
tempg->selected=Bt(&doc_e->type,DOCEt_SELECTED);
|
tempg->sel=Bt(&doc_e->type,DOCEt_SEL);
|
||||||
if (*_cur_elem_num==doc_e->left_exp) {
|
if (*_cur_elem_num==doc_e->left_exp) {
|
||||||
*_cur_elem_num=num;
|
*_cur_elem_num=num;
|
||||||
found=TRUE;
|
found=TRUE;
|
||||||
@@ -627,8 +627,8 @@ U0 SpriteSideBarPickNew(CDoc *doc,CSprite *root,I64 old_num)
|
|||||||
DocPrint(doc,"$$LTBLUE$$");
|
DocPrint(doc,"$$LTBLUE$$");
|
||||||
doc_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
doc_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||||
}
|
}
|
||||||
BEqu(&doc_e->de_flags,DOCEf_SELECTED,tempg->selected);
|
BEqu(&doc_e->de_flags,DOCEf_SEL,tempg->sel);
|
||||||
BEqu(&doc_e->type,DOCEt_SELECTED,tempg->selected);
|
BEqu(&doc_e->type,DOCEt_SEL,tempg->sel);
|
||||||
Free(st);
|
Free(st);
|
||||||
tempg=tempg->next;
|
tempg=tempg->next;
|
||||||
}
|
}
|
||||||
@@ -715,13 +715,13 @@ Bool SpriteEdText(CSprite **_root,I64 *_cur_elem_num)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GED_SELECT_UNSELECT_ALL 0
|
#define GED_SEL_UNSEL_ALL 0
|
||||||
#define GED_SELECT 1
|
#define GED_SEL 1
|
||||||
#define GED_UNSELECT 2
|
#define GED_UNSEL 2
|
||||||
#define GED_SHIFT_PTS 3
|
#define GED_SHIFT_PTS 3
|
||||||
#define GED_SHIFT_RECTS 4
|
#define GED_SHIFT_RECTS 4
|
||||||
#define GED_SHIFT_SELECTED 5
|
#define GED_SHIFT_SEL 5
|
||||||
#define GED_TRANSFORM_SELECTED 6
|
#define GED_TRANSFORM_SEL 6
|
||||||
#define GED_SET_ORIGIN 7
|
#define GED_SET_ORIGIN 7
|
||||||
#define GED_SHIFT_SUB_ORIGIN 8
|
#define GED_SHIFT_SUB_ORIGIN 8
|
||||||
#define GED_TEXT_ED 9
|
#define GED_TEXT_ED 9
|
||||||
@@ -731,7 +731,7 @@ Bool SpriteEdText(CSprite **_root,I64 *_cur_elem_num)
|
|||||||
|
|
||||||
U0 GrInit3()
|
U0 GrInit3()
|
||||||
{
|
{
|
||||||
DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unslesct All\0"
|
DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unselect All\0"
|
||||||
"Select\0Unselect\0Shift Points\0Shift Rects\0Shift Selected\0"
|
"Select\0Unselect\0Shift Points\0Shift Rects\0Shift Selected\0"
|
||||||
"Transform Selected\0Set Origin\0Insert Shift SubOrigin\0"
|
"Transform Selected\0Set Origin\0Insert Shift SubOrigin\0"
|
||||||
"Edit as Text\0Insert Clipboard\0Main Menu\0");
|
"Edit as Text\0Insert Clipboard\0Main Menu\0");
|
||||||
@@ -746,13 +746,13 @@ I64 PopUpSpriteEd(CSprite **_root,I64 *_cur_elem_num)
|
|||||||
CDoc *doc=DocNew;
|
CDoc *doc=DocNew;
|
||||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite Edit Menu\"$$\n"
|
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite Edit Menu\"$$\n"
|
||||||
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteEd.TXT.Z\"$$\n\n"
|
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteEd.TXT.Z\"$$\n\n"
|
||||||
"$$LTBLUE$$$$MU-UL,\"Select/Unselect All\",LE=GED_SELECT_UNSELECT_ALL$$\n"
|
"$$LTBLUE$$$$MU-UL,\"Select/Unselect All\",LE=GED_SEL_UNSEL_ALL$$\n"
|
||||||
"$$MU-UL,\"Select Elems\",LE=GED_SELECT$$\n"
|
"$$MU-UL,\"Select Elems\",LE=GED_SEL$$\n"
|
||||||
"$$MU-UL,\"Unselect Elems\",LE=GED_UNSELECT$$\n\n"
|
"$$MU-UL,\"Unsel Elems\",LE=GED_UNSEL$$\n\n"
|
||||||
"$$MU-UL,\"Shift Points\",LE=GED_SHIFT_PTS$$\n"
|
"$$MU-UL,\"Shift Points\",LE=GED_SHIFT_PTS$$\n"
|
||||||
"$$MU-UL,\"Shift Points with Rects\",LE=GED_SHIFT_RECTS$$\n"
|
"$$MU-UL,\"Shift Points with Rects\",LE=GED_SHIFT_RECTS$$\n"
|
||||||
"$$MU-UL,\"Shift Selected Elems\",LE=GED_SHIFT_SELECTED$$\n"
|
"$$MU-UL,\"Shift Selected Elems\",LE=GED_SHIFT_SEL$$\n"
|
||||||
"$$MU-UL,\"Transform Selected Elems\",LE=GED_TRANSFORM_SELECTED$$\n\n"
|
"$$MU-UL,\"Transform Selected Elems\",LE=GED_TRANSFORM_SEL$$\n\n"
|
||||||
"$$MU-UL,\"Set Origin\",LE=GED_SET_ORIGIN$$\n"
|
"$$MU-UL,\"Set Origin\",LE=GED_SET_ORIGIN$$\n"
|
||||||
"$$MU-UL,\"Insert Shift SubOrigin\",LE=GED_SHIFT_SUB_ORIGIN$$\n\n"
|
"$$MU-UL,\"Insert Shift SubOrigin\",LE=GED_SHIFT_SUB_ORIGIN$$\n\n"
|
||||||
"$$MU-UL,\"Edit as Text\",LE=GED_TEXT_ED$$\n"
|
"$$MU-UL,\"Edit as Text\",LE=GED_TEXT_ED$$\n"
|
||||||
@@ -775,7 +775,7 @@ I64 PopUpSpriteEd(CSprite **_root,I64 *_cur_elem_num)
|
|||||||
#define GSPT_SIMPLE_PT 0
|
#define GSPT_SIMPLE_PT 0
|
||||||
#define GSPT_WIDTH_HEIGHT 1
|
#define GSPT_WIDTH_HEIGHT 1
|
||||||
|
|
||||||
#define GSPF_SELECTED 1
|
#define GSPF_SEL 1
|
||||||
|
|
||||||
class CEdSprite
|
class CEdSprite
|
||||||
{
|
{
|
||||||
@@ -920,7 +920,7 @@ U0 SpriteCtrlPtsDraw(CDC *dc,CEdSprite *root)
|
|||||||
y=*temppe->h+*temppe->y+temppe->yy;
|
y=*temppe->h+*temppe->y+temppe->yy;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (temppe->flags&GSPF_SELECTED)
|
if (temppe->flags&GSPF_SEL)
|
||||||
dc->color=RED;
|
dc->color=RED;
|
||||||
else
|
else
|
||||||
dc->color=BLACK;
|
dc->color=BLACK;
|
||||||
@@ -937,7 +937,7 @@ U0 SpriteCtrlPtsMove(CEdSprite *root,I64 dx,I64 dy)
|
|||||||
CEdSprite *temppe;
|
CEdSprite *temppe;
|
||||||
temppe=root->next;
|
temppe=root->next;
|
||||||
while (temppe!=root) {
|
while (temppe!=root) {
|
||||||
if (temppe->flags&GSPF_SELECTED)
|
if (temppe->flags&GSPF_SEL)
|
||||||
switch (temppe->type) {
|
switch (temppe->type) {
|
||||||
case GSPT_SIMPLE_PT:
|
case GSPT_SIMPLE_PT:
|
||||||
if (temppe->x) *temppe->x+=dx;
|
if (temppe->x) *temppe->x+=dx;
|
||||||
@@ -990,7 +990,7 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
|||||||
temppe=temppe->next;
|
temppe=temppe->next;
|
||||||
}
|
}
|
||||||
cur_elem_num=best_pe->num;
|
cur_elem_num=best_pe->num;
|
||||||
best_pe->flags|=GSPF_SELECTED;
|
best_pe->flags|=GSPF_SEL;
|
||||||
break;
|
break;
|
||||||
case GED_SHIFT_RECTS:
|
case GED_SHIFT_RECTS:
|
||||||
xx2=xx=a1; yy2=yy=a2;
|
xx2=xx=a1; yy2=yy=a2;
|
||||||
@@ -1013,12 +1013,12 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
|||||||
case GSPT_SIMPLE_PT:
|
case GSPT_SIMPLE_PT:
|
||||||
if (xx<=*temppe->x+temppe->xx<=xx2 &&
|
if (xx<=*temppe->x+temppe->xx<=xx2 &&
|
||||||
yy<=*temppe->y+temppe->yy<=yy2)
|
yy<=*temppe->y+temppe->yy<=yy2)
|
||||||
temppe->flags|=GSPF_SELECTED;
|
temppe->flags|=GSPF_SEL;
|
||||||
break;
|
break;
|
||||||
case GSPT_WIDTH_HEIGHT:
|
case GSPT_WIDTH_HEIGHT:
|
||||||
if (xx<=*temppe->x+*temppe->w+temppe->xx<=xx2 &&
|
if (xx<=*temppe->x+*temppe->w+temppe->xx<=xx2 &&
|
||||||
yy<=*temppe->y+*temppe->h+temppe->yy<=yy2)
|
yy<=*temppe->y+*temppe->h+temppe->yy<=yy2)
|
||||||
temppe->flags|=GSPF_SELECTED;
|
temppe->flags|=GSPF_SEL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
temppe=temppe->next;
|
temppe=temppe->next;
|
||||||
@@ -1040,7 +1040,7 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
|||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
temppe=root.next;
|
temppe=root.next;
|
||||||
while (temppe!=&root) {
|
while (temppe!=&root) {
|
||||||
temppe->flags&=~GSPF_SELECTED;
|
temppe->flags&=~GSPF_SEL;
|
||||||
temppe=temppe->next;
|
temppe=temppe->next;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1089,7 +1089,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
|||||||
old_de_flags=doc_ce->de_flags;
|
old_de_flags=doc_ce->de_flags;
|
||||||
tempb=doc_ce->bin_data;
|
tempb=doc_ce->bin_data;
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
SpriteQueSelectAll(*_root,FALSE);
|
SpriteQueSelAll(*_root,FALSE);
|
||||||
do {
|
do {
|
||||||
if (winmgr.fps<10)
|
if (winmgr.fps<10)
|
||||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||||
@@ -1099,14 +1099,14 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
|||||||
if (0<=i<GED_EXIT) {
|
if (0<=i<GED_EXIT) {
|
||||||
StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_ED_MENU"));
|
StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_ED_MENU"));
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case GED_SELECT_UNSELECT_ALL:
|
case GED_SEL_UNSEL_ALL:
|
||||||
if (!SpriteQueSelectCnt(*_root))
|
if (!SpriteQueSelCnt(*_root))
|
||||||
SpriteQueSelectAll(*_root);
|
SpriteQueSelAll(*_root);
|
||||||
else
|
else
|
||||||
SpriteQueSelectAll(*_root,FALSE);
|
SpriteQueSelAll(*_root,FALSE);
|
||||||
break;
|
break;
|
||||||
case GED_SELECT:
|
case GED_SEL:
|
||||||
case GED_UNSELECT:
|
case GED_UNSEL:
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
doc->cur_sprite=tempb->data;
|
doc->cur_sprite=tempb->data;
|
||||||
do {
|
do {
|
||||||
@@ -1116,23 +1116,23 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
|||||||
if (msg_code==MSG_IP_L_DOWN) {
|
if (msg_code==MSG_IP_L_DOWN) {
|
||||||
*_cur_elem_num=doc->nearest_sprite_elem_num;
|
*_cur_elem_num=doc->nearest_sprite_elem_num;
|
||||||
cur_elem=SpriteSetSettings(,*_root,*_cur_elem_num);
|
cur_elem=SpriteSetSettings(,*_root,*_cur_elem_num);
|
||||||
cur_elem->selected=ToBool(i==GED_SELECT);
|
cur_elem->sel=ToBool(i==GED_SEL);
|
||||||
GetMsg(,,1<<MSG_IP_L_UP);
|
GetMsg(,,1<<MSG_IP_L_UP);
|
||||||
}
|
}
|
||||||
} while (msg_code!=MSG_IP_R_UP);
|
} while (msg_code!=MSG_IP_R_UP);
|
||||||
doc->cur_sprite=NULL;
|
doc->cur_sprite=NULL;
|
||||||
break;
|
break;
|
||||||
case GED_SET_ORIGIN:
|
case GED_SET_ORIGIN:
|
||||||
SpriteQueSelectAll(*_root);
|
SpriteQueSelAll(*_root);
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
GetMsg(&a1,&a2,1<<MSG_IP_L_UP);
|
GetMsg(&a1,&a2,1<<MSG_IP_L_UP);
|
||||||
SpriteSetOrigin(*_root,x-a1,y-a2,0);
|
SpriteSetOrigin(*_root,x-a1,y-a2,0);
|
||||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||||
SpriteQueSelectAll(*_root,FALSE);
|
SpriteQueSelAll(*_root,FALSE);
|
||||||
break;
|
break;
|
||||||
case GED_SHIFT_SELECTED:
|
case GED_SHIFT_SEL:
|
||||||
if (!SpriteQueSelectCnt(*_root))
|
if (!SpriteQueSelCnt(*_root))
|
||||||
SpriteQueSelectAll(*_root);
|
SpriteQueSelAll(*_root);
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
GetMsg(&a1,&a2,1<<MSG_IP_L_DOWN);
|
GetMsg(&a1,&a2,1<<MSG_IP_L_DOWN);
|
||||||
xx=a1; yy=a2;
|
xx=a1; yy=a2;
|
||||||
@@ -1143,8 +1143,8 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
|||||||
xx=a1; yy=a2;
|
xx=a1; yy=a2;
|
||||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
if (!SpriteQueSelectCnt(*_root,FALSE))
|
if (!SpriteQueSelCnt(*_root,FALSE))
|
||||||
SpriteQueSelectAll(*_root,FALSE);
|
SpriteQueSelAll(*_root,FALSE);
|
||||||
break;
|
break;
|
||||||
case GED_SHIFT_PTS:
|
case GED_SHIFT_PTS:
|
||||||
case GED_SHIFT_RECTS:
|
case GED_SHIFT_RECTS:
|
||||||
@@ -1161,15 +1161,15 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
|||||||
} else
|
} else
|
||||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||||
break;
|
break;
|
||||||
case GED_TRANSFORM_SELECTED:
|
case GED_TRANSFORM_SEL:
|
||||||
if (!SpriteQueSelectCnt(*_root))
|
if (!SpriteQueSelCnt(*_root))
|
||||||
SpriteQueSelectAll(*_root);
|
SpriteQueSelAll(*_root);
|
||||||
if (PopUpTransform(r)) {
|
if (PopUpTransform(r)) {
|
||||||
SpriteTransform(r,*_root);
|
SpriteTransform(r,*_root);
|
||||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||||
}
|
}
|
||||||
if (!SpriteQueSelectCnt(*_root,FALSE))
|
if (!SpriteQueSelCnt(*_root,FALSE))
|
||||||
SpriteQueSelectAll(*_root,FALSE);
|
SpriteQueSelAll(*_root,FALSE);
|
||||||
break;
|
break;
|
||||||
case GED_SHIFT_SUB_ORIGIN:
|
case GED_SHIFT_SUB_ORIGIN:
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
|
|||||||
@@ -581,7 +581,7 @@ U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,CDC *dc,
|
|||||||
|
|
||||||
I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||||
CDC *dc,I64 xx,I64 yy,I64 a1,I64 a2,CColorROPU32 bm_bkcolor,
|
CDC *dc,I64 xx,I64 yy,I64 a1,I64 a2,CColorROPU32 bm_bkcolor,
|
||||||
Bool select,I64 xx1=0,I64 yy1=0,I64 xx2=0,I64 yy2=0,I64 *_cur_elem_num)
|
Bool sel,I64 xx1=0,I64 yy1=0,I64 xx2=0,I64 yy2=0,I64 *_cur_elem_num)
|
||||||
{
|
{
|
||||||
I64 i,msg_code,x=xx,y=yy,x1=a1,y1=a2,x2=a1,y2=a2,old_width;
|
I64 i,msg_code,x=xx,y=yy,x1=a1,y1=a2,x2=a1,y2=a2,old_width;
|
||||||
CSprite *tempg,*tempg1,*insert_pt;
|
CSprite *tempg,*tempg1,*insert_pt;
|
||||||
@@ -590,7 +590,7 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
|||||||
insert_pt=SpriteSetSettings(,root,*_cur_elem_num,xx,yy,,,&x,&y);
|
insert_pt=SpriteSetSettings(,root,*_cur_elem_num,xx,yy,,,&x,&y);
|
||||||
x+=xx; y+=yy;
|
x+=xx; y+=yy;
|
||||||
|
|
||||||
if (select) {
|
if (sel) {
|
||||||
xx1=a1; yy1=a2;
|
xx1=a1; yy1=a2;
|
||||||
xx2=a1; yy2=a2;
|
xx2=a1; yy2=a2;
|
||||||
old_width=dc->pen_width;
|
old_width=dc->pen_width;
|
||||||
@@ -1077,7 +1077,7 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
break;
|
break;
|
||||||
case MSG_IP_L_DOWN:
|
case MSG_IP_L_DOWN:
|
||||||
switch (eletype) {
|
switch (eletype) {
|
||||||
sub_switch_start:
|
start:
|
||||||
case SPT_LINE:
|
case SPT_LINE:
|
||||||
tempg=SMLine(dc,x,y,a1,a2,color);
|
tempg=SMLine(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
@@ -1124,7 +1124,7 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
tempg=SMPolyPoint(dc,x,y,a1,a2,color);
|
tempg=SMPolyPoint(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
sub_switch_end:
|
end:
|
||||||
if (tempg) {
|
if (tempg) {
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tempg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,root);
|
SpriteEdUpdate(doc,doc_ce,root);
|
||||||
|
|||||||
+316
-203
File diff suppressed because it is too large.
Load diff
@@ -58,7 +58,7 @@ BDVD_NOT64_MSG:
|
|||||||
BDVD_BLK_LO:: DU16 0;
|
BDVD_BLK_LO:: DU16 0;
|
||||||
BDVD_BLK_HI:: DU16 0;
|
BDVD_BLK_HI:: DU16 0;
|
||||||
BDVD_BLK_CNT:: DU16 0;
|
BDVD_BLK_CNT:: DU16 0;
|
||||||
|
BDVD_SHIFT_BLKS:: DU16 0;
|
||||||
BDVD_PROGRESS_STEP:: DU32 0;
|
BDVD_PROGRESS_STEP:: DU32 0;
|
||||||
BDVD_PROGRESS_VAL:: DU32 0;
|
BDVD_PROGRESS_VAL:: DU32 0;
|
||||||
|
|
||||||
@@ -150,10 +150,35 @@ BDVD_MAIN::
|
|||||||
POP CX
|
POP CX
|
||||||
LOOP @@20
|
LOOP @@20
|
||||||
|
|
||||||
|
//Shift backward to align
|
||||||
|
PUSH DS
|
||||||
|
MOV BX,U16 [BDVD_SHIFT_BLKS-BDVD_START]
|
||||||
|
SHL BX,BLK_SIZE_BITS-4
|
||||||
|
MOV CX,U16 [BDVD_BLK_CNT-BDVD_START]
|
||||||
|
MOV AX,BOOT_RAM_BASE/16
|
||||||
|
MOV ES,AX
|
||||||
|
ADD AX,BX
|
||||||
|
MOV DS,AX
|
||||||
|
@@35: PUSH CX
|
||||||
|
XOR SI,SI
|
||||||
|
XOR DI,DI
|
||||||
|
MOV CX,DVD_BLK_SIZE/4
|
||||||
|
REP_MOVSD
|
||||||
|
MOV AX,DS
|
||||||
|
ADD AX,DVD_BLK_SIZE/16
|
||||||
|
MOV DS,AX
|
||||||
|
MOV AX,ES
|
||||||
|
ADD AX,DVD_BLK_SIZE/16
|
||||||
|
MOV ES,AX
|
||||||
|
POP CX
|
||||||
|
LOOP @@35
|
||||||
|
POP DS
|
||||||
|
|
||||||
//See $LK,"BootDVDProve",A="MN:BootDVDProve"$().
|
//See $LK,"BootDVDProve",A="MN:BootDVDProve"$().
|
||||||
MOV EBX,U32 [BDVD_BLK_LO-BDVD_START] //TODO: oops overflow?
|
MOV EBX,U32 [BDVD_BLK_LO-BDVD_START]
|
||||||
SHL EBX,16
|
MOV AX,U16 [BDVD_SHIFT_BLKS-BDVD_START]
|
||||||
MOV BX,BOOT_SRC_DVD //$MA-X+PU,"See sys_boot_src",LM="Find(\"sys_boot_src\",\"/*\");View;\n"$
|
SHL EAX,16
|
||||||
|
MOV AX,BOOT_SRC_DVD //$MA-X+PU,"See sys_boot_src",LM="Find(\"sys_boot_src\",\"/*\");View;\n"$
|
||||||
|
|
||||||
//My assembler doesn't support 16-bit very well.
|
//My assembler doesn't support 16-bit very well.
|
||||||
DU8 0xEA; //JMP BOOT_RAM_BASE:0000
|
DU8 0xEA; //JMP BOOT_RAM_BASE:0000
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ BHD_HISTART:
|
|||||||
@@10: POP CX
|
@@10: POP CX
|
||||||
LOOP @@05
|
LOOP @@05
|
||||||
|
|
||||||
MOV EBX,BOOT_SRC_HARDDRV //$MA-X+PU,"See sys_boot_src",LM="Find(\"sys_boot_src\",\"/*\");View;\n"$
|
XOR EBX,EBX
|
||||||
|
MOV EAX,BOOT_SRC_HARDDRV //$MA-X+PU,"See sys_boot_src",LM="Find(\"sys_boot_src\",\"/*\");View;\n"$
|
||||||
//My assembler doesn't support 16-bit very well.
|
//My assembler doesn't support 16-bit very well.
|
||||||
DU8 0xEA; //JMP BOOT_RAM_BASE:0000
|
DU8 0xEA; //JMP BOOT_RAM_BASE:0000
|
||||||
DU16 0,BOOT_RAM_BASE/16;
|
DU16 0,BOOT_RAM_BASE/16;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public Bool MakeOSDrvBootInstall(U8 src_drv=0,U8 dst_drv=0)
|
|||||||
if (!Drv(src_drv))
|
if (!Drv(src_drv))
|
||||||
throw;
|
throw;
|
||||||
MakeAll;
|
MakeAll;
|
||||||
if ((bd=Let2BlkDev(dst_drv,FALSE)) && (dv=Let2Drv(dst_drv,FALSE)))
|
if ((dv=Let2Drv(dst_drv,FALSE)) && (bd=dv->bd))
|
||||||
type=bd->type;
|
type=bd->type;
|
||||||
else {
|
else {
|
||||||
type=BDT_ATAPI;
|
type=BDT_ATAPI;
|
||||||
@@ -56,6 +56,7 @@ public Bool MakeOSDrvBootInstall(U8 src_drv=0,U8 dst_drv=0)
|
|||||||
}
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BDT_ATAPI:
|
case BDT_ATAPI:
|
||||||
|
case BDT_FILE:
|
||||||
Move("/Kernel/Kernel.BIN.Z",BOOT_DIR_KERNEL_BIN_C);
|
Move("/Kernel/Kernel.BIN.Z",BOOT_DIR_KERNEL_BIN_C);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -67,7 +68,7 @@ public Bool MakeOSDrvBootInstall(U8 src_drv=0,U8 dst_drv=0)
|
|||||||
else {
|
else {
|
||||||
Free(de.full_name);
|
Free(de.full_name);
|
||||||
"Modifying partition boot record.\n";
|
"Modifying partition boot record.\n";
|
||||||
RBlks(dv,&br,dv->base_offset,1);
|
RBlks(dv,&br,dv->drv_offset,1);
|
||||||
br.jump_and_nop[0]=OC_JMP_REL8;
|
br.jump_and_nop[0]=OC_JMP_REL8;
|
||||||
br.jump_and_nop[1]=offset(CFAT32Boot.code)-2;
|
br.jump_and_nop[1]=offset(CFAT32Boot.code)-2;
|
||||||
#assert offset(CFAT32Boot.code)>=offset(CRedSeaBoot.code)
|
#assert offset(CFAT32Boot.code)>=offset(CRedSeaBoot.code)
|
||||||
@@ -79,7 +80,7 @@ public Bool MakeOSDrvBootInstall(U8 src_drv=0,U8 dst_drv=0)
|
|||||||
#assert sizeof(CFAT32Boot.code)>=BHD_END-BHD_CODE
|
#assert sizeof(CFAT32Boot.code)>=BHD_END-BHD_CODE
|
||||||
for (;i<sizeof(CFAT32Boot.code);i++)
|
for (;i<sizeof(CFAT32Boot.code);i++)
|
||||||
br.code[i]=0;
|
br.code[i]=0;
|
||||||
WBlks(dv,&br,dv->base_offset,1);
|
WBlks(dv,&br,dv->drv_offset,1);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -172,7 +173,7 @@ public Bool MasterBootInstall(U8 drv_let,U8 *drv_lst=NULL)
|
|||||||
if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32)
|
if (dv->fs_type!=FSt_REDSEA && dv->fs_type!=FSt_FAT32)
|
||||||
PrintErr("File System Not Supported\n");
|
PrintErr("File System Not Supported\n");
|
||||||
else {
|
else {
|
||||||
bd=Let2BlkDev(drv_let);
|
bd=dv->bd;
|
||||||
if (!FileFind(BOOT_DIR_OLDMBR_BIN_C,,FUF_JUST_FILES))
|
if (!FileFind(BOOT_DIR_OLDMBR_BIN_C,,FUF_JUST_FILES))
|
||||||
MasterBootOldRead(drv_let,drv_let);
|
MasterBootOldRead(drv_let,drv_let);
|
||||||
|
|
||||||
@@ -190,14 +191,14 @@ public Bool MasterBootInstall(U8 drv_let,U8 *drv_lst=NULL)
|
|||||||
|
|
||||||
ptr=buf;
|
ptr=buf;
|
||||||
while (ch=*ptr++) {
|
while (ch=*ptr++) {
|
||||||
if ((p1=Let2Drv(ch,FALSE)) && (bd1=Let2BlkDev(ch,FALSE)) && bd1==bd) {
|
if ((p1=Let2Drv(ch,FALSE)) && (bd1=p1->bd) && bd1==bd) {
|
||||||
*_q=p1->base_offset;
|
*_q=p1->drv_offset;
|
||||||
"Drive %C:%16X\n",Drv2Let(p1),*_q;
|
"Drive %C:%16X\n",Drv2Let(p1),*_q;
|
||||||
CatPrint(menu_ptr,"%d. Drive %C\n\r",j++,Drv2Let(p1));
|
CatPrint(menu_ptr,"%d. Drive %C\n\r",j++,Drv2Let(p1));
|
||||||
_q++;
|
_q++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CatPrint(menu_ptr,"\n\rSelection:");
|
CatPrint(menu_ptr,"\n\rSellection:");
|
||||||
|
|
||||||
size=BMHD2_END-BMHD2_START;
|
size=BMHD2_END-BMHD2_START;
|
||||||
FileWrite(BOOT_DIR_BOOTMHD2_BIN_C,BMHD2_START,size);
|
FileWrite(BOOT_DIR_BOOTMHD2_BIN_C,BMHD2_START,size);
|
||||||
|
|||||||
@@ -1,27 +1,13 @@
|
|||||||
#help_index "File/CD DVD"
|
#help_index "File/CD DVD"
|
||||||
|
|
||||||
U0 FillU16Palindrome(CPalindromeU16 *dst,U16 w)
|
|
||||||
{
|
|
||||||
dst->big=EndianU16(w);
|
|
||||||
dst->little=w;
|
|
||||||
}
|
|
||||||
|
|
||||||
U0 FillU32Palindrome(CPalindromeU32 *dst,I64 d)
|
|
||||||
{
|
|
||||||
dst->big=EndianU32(d);
|
|
||||||
dst->little=d;
|
|
||||||
}
|
|
||||||
|
|
||||||
class CCDVDUserData //Create DVD
|
class CCDVDUserData //Create DVD
|
||||||
{
|
{
|
||||||
I64 loc,path_entry_num,
|
I64 loc,path_entry_num,
|
||||||
short_dir_blks,long_dir_blks;
|
short_dir_blks,long_dir_blks;
|
||||||
};
|
};
|
||||||
|
|
||||||
I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,
|
I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||||
CISO1DirEntry *tempi,CISO1DirEntry *tempi2,
|
CISO1DirEntry *tempi2,I64 *_cur_blk,CDirEntry *parent,Bool write,
|
||||||
I64 *_cur_blk,
|
|
||||||
CDirEntry *parent,Bool write,
|
|
||||||
U8 *stage2_filename,I64 *_stage2_blk)
|
U8 *stage2_filename,I64 *_stage2_blk)
|
||||||
{
|
{
|
||||||
CCDVDUserData *tempc;
|
CCDVDUserData *tempc;
|
||||||
@@ -65,7 +51,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,
|
|||||||
de2->flags=ISO1_ATTR_DIR;
|
de2->flags=ISO1_ATTR_DIR;
|
||||||
de2->name_len=1;
|
de2->name_len=1;
|
||||||
de2->name=0;
|
de2->name=0;
|
||||||
de2->len=de2->len+de2->name_len;
|
de2->len+=de2->name_len;
|
||||||
de2(U8 *)+=de2->len;
|
de2(U8 *)+=de2->len;
|
||||||
|
|
||||||
de2->len=sizeof(CISO1DirEntry)-1;
|
de2->len=sizeof(CISO1DirEntry)-1;
|
||||||
@@ -315,20 +301,7 @@ U0 DVDFillPathTable(CDirEntry *tempde,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CElTorito
|
public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||||
{
|
|
||||||
U16 w[16];
|
|
||||||
U8 bootable; //88=bootable 00=not bootable
|
|
||||||
U8 media_type; //0=no emulation 4=hard disk
|
|
||||||
U16 load_seg; //0000->07C0
|
|
||||||
U8 sys_type;
|
|
||||||
U8 zero;
|
|
||||||
U16 sect_cnt;
|
|
||||||
U32 load_rba; //start addr of virtual disk
|
|
||||||
U8 zero2[20];
|
|
||||||
};
|
|
||||||
|
|
||||||
public I64 ISOFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,
|
|
||||||
U8 *fu_flags=NULL,U8 *_stage2_filename=NULL)
|
U8 *fu_flags=NULL,U8 *_stage2_filename=NULL)
|
||||||
{//See $LK,"::/Misc/DoDistro.CPP"$
|
{//See $LK,"::/Misc/DoDistro.CPP"$
|
||||||
//Use "C:/Distro/*" if you want all files in the C:/Distro directory.
|
//Use "C:/Distro/*" if you want all files in the C:/Distro directory.
|
||||||
@@ -338,7 +311,7 @@ public I64 ISOFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,
|
|||||||
*iso_sup=CAlloc(DVD_BLK_SIZE),
|
*iso_sup=CAlloc(DVD_BLK_SIZE),
|
||||||
*iso_term=CAlloc(DVD_BLK_SIZE);
|
*iso_term=CAlloc(DVD_BLK_SIZE);
|
||||||
CDirEntry *rootdir=CAlloc(sizeof(CDirEntry));
|
CDirEntry *rootdir=CAlloc(sizeof(CDirEntry));
|
||||||
I64 i,j,stage2_blk=(DVD_FILE_OFFSET+1<<2+DVD_BOOT_LOADER_SIZE/BLK_SIZE)>>2,
|
I64 i,j,stage2_blk=(20<<2+1<<2+DVD_BOOT_LOADER_SIZE/BLK_SIZE)>>2,
|
||||||
stage2_size,cur_blk=0,tabsize,tabsize2,first_free,max_depth,fuf_flags=0;
|
stage2_size,cur_blk=0,tabsize,tabsize2,first_free,max_depth,fuf_flags=0;
|
||||||
U32 *d;
|
U32 *d;
|
||||||
CElTorito *et=CAlloc(DVD_BLK_SIZE);
|
CElTorito *et=CAlloc(DVD_BLK_SIZE);
|
||||||
@@ -369,13 +342,12 @@ public I64 ISOFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,
|
|||||||
tempc=rootdir->user_data;
|
tempc=rootdir->user_data;
|
||||||
tempc->path_entry_num=1;
|
tempc->path_entry_num=1;
|
||||||
|
|
||||||
cur_blk=DVD_FILE_OFFSET>>2;
|
cur_blk=20<<2>>2;
|
||||||
if (stage2_filename) //preboot and bootloader
|
if (stage2_filename) //preboot and bootloader
|
||||||
cur_blk+=1+DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE;
|
cur_blk+=1+DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE;
|
||||||
DVDFileCreate2(out_file,rootdir,
|
DVDFileCreate2(out_file,rootdir,&iso_pri->root_dir_record,
|
||||||
&iso_pri->root_dir_record,
|
&iso_sup->root_dir_record,&cur_blk,rootdir,FALSE,
|
||||||
&iso_sup->root_dir_record,
|
stage2_filename,&stage2_blk);
|
||||||
&cur_blk,rootdir,FALSE,stage2_filename,&stage2_blk);
|
|
||||||
tabsize=sizeof(CISO1PathEntry);
|
tabsize=sizeof(CISO1PathEntry);
|
||||||
tabsize2=sizeof(CISO1PathEntry);
|
tabsize2=sizeof(CISO1PathEntry);
|
||||||
max_depth=DVDTableLen(rootdir,&tabsize,&tabsize2,1);
|
max_depth=DVDTableLen(rootdir,&tabsize,&tabsize2,1);
|
||||||
@@ -394,7 +366,7 @@ public I64 ISOFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,
|
|||||||
if (!out_file)
|
if (!out_file)
|
||||||
goto cf_done;
|
goto cf_done;
|
||||||
|
|
||||||
while (cur_blk<DVD_FILE_OFFSET>>2)
|
while (cur_blk<20<<2>>2)
|
||||||
FWBlks(out_file,zero_buf,cur_blk++<<2,4);
|
FWBlks(out_file,zero_buf,cur_blk++<<2,4);
|
||||||
|
|
||||||
iso_pri->type=ISO1T_PRI_VOL_DESC;
|
iso_pri->type=ISO1T_PRI_VOL_DESC;
|
||||||
@@ -418,7 +390,7 @@ public I64 ISOFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,
|
|||||||
iso_boot->version=1;
|
iso_boot->version=1;
|
||||||
StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION");
|
StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION");
|
||||||
|
|
||||||
cur_blk=DVD_FILE_OFFSET>>2;
|
cur_blk=20<<2>>2;
|
||||||
|
|
||||||
if (stage2_filename) {
|
if (stage2_filename) {
|
||||||
d=iso_boot(U8 *)+0x47;
|
d=iso_boot(U8 *)+0x47;
|
||||||
@@ -511,7 +483,7 @@ public I64 ISOFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,
|
|||||||
"$$RED$$!!! Boot Stage 2 !!! %X-%X$$FG$$\n",
|
"$$RED$$!!! Boot Stage 2 !!! %X-%X$$FG$$\n",
|
||||||
stage2_blk,stage2_blk+stage2_size-1;
|
stage2_blk,stage2_blk+stage2_size-1;
|
||||||
FWBlks(out_file,stage1_buf,
|
FWBlks(out_file,stage1_buf,
|
||||||
DVD_FILE_OFFSET+1<<2,DVD_BOOT_LOADER_SIZE/BLK_SIZE);
|
20<<2+1<<2,DVD_BOOT_LOADER_SIZE/BLK_SIZE);
|
||||||
} else {
|
} else {
|
||||||
FWBlks(out_file,iso_sup,17<<2,4);
|
FWBlks(out_file,iso_sup,17<<2,4);
|
||||||
FWBlks(out_file,iso_term,18<<2,4);
|
FWBlks(out_file,iso_term,18<<2,4);
|
||||||
@@ -0,0 +1,186 @@
|
|||||||
|
#help_index "File/CD DVD"
|
||||||
|
|
||||||
|
U0 FillU16Palindrome(CPalindromeU16 *dst,U16 w)
|
||||||
|
{
|
||||||
|
dst->big=EndianU16(w);
|
||||||
|
dst->little=w;
|
||||||
|
}
|
||||||
|
|
||||||
|
U0 FillU32Palindrome(CPalindromeU32 *dst,I64 d)
|
||||||
|
{
|
||||||
|
dst->big=EndianU32(d);
|
||||||
|
dst->little=d;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CElTorito
|
||||||
|
{
|
||||||
|
U16 w[16];
|
||||||
|
U8 bootable; //88=bootable 00=not bootable
|
||||||
|
U8 media_type; //0=no emulation 4=hard disk
|
||||||
|
U16 load_seg; //0000->07C0
|
||||||
|
U8 sys_type;
|
||||||
|
U8 zero;
|
||||||
|
U16 sect_cnt;
|
||||||
|
U32 load_rba; //start addr of virtual disk
|
||||||
|
U8 zero2[20];
|
||||||
|
};
|
||||||
|
|
||||||
|
U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let,I64 stage2_blk=0,I64 stage2_size=0)
|
||||||
|
{
|
||||||
|
CDrv *dv=Let2Drv(drv_let);
|
||||||
|
CISO1PriDesc *iso_pri=CAlloc(DVD_BLK_SIZE),
|
||||||
|
*iso_boot=CAlloc(DVD_BLK_SIZE),
|
||||||
|
*iso_sup=CAlloc(DVD_BLK_SIZE),
|
||||||
|
*iso_term=CAlloc(DVD_BLK_SIZE);
|
||||||
|
I64 iso_size=0,i,j;
|
||||||
|
U32 *d;
|
||||||
|
CElTorito *et=CAlloc(DVD_BLK_SIZE);
|
||||||
|
U8 *stage1_buf=CAlloc(DVD_BOOT_LOADER_SIZE),
|
||||||
|
*zero_buf=CAlloc(DVD_BLK_SIZE);
|
||||||
|
CFile *out_file=NULL;
|
||||||
|
|
||||||
|
if (out_file=FOpen(iso_filename,"wc+")) {
|
||||||
|
iso_size=FSize(out_file)/DVD_BLK_SIZE;
|
||||||
|
for (i=0;i<dv->bd->drv_offset;i+=4)
|
||||||
|
FWBlks(out_file,zero_buf,i,4);
|
||||||
|
|
||||||
|
iso_pri->type=ISO1T_PRI_VOL_DESC;
|
||||||
|
StrCpy(iso_pri->id,"CD001");
|
||||||
|
iso_pri->version=1;
|
||||||
|
FillU16Palindrome(&iso_pri->vol_set_size,1);
|
||||||
|
FillU16Palindrome(&iso_pri->vol_seq_num,1);
|
||||||
|
FillU16Palindrome(&iso_pri->log_block_size,DVD_BLK_SIZE);
|
||||||
|
FillU32Palindrome(&iso_pri->vol_space_size,iso_size);
|
||||||
|
FillU32Palindrome(&iso_pri->root_dir_record,dv->root_cluster);
|
||||||
|
iso_pri->file_structure_version=1;
|
||||||
|
StrCpy(iso_pri->publisher_id,"TempleOS RedSea");
|
||||||
|
|
||||||
|
MemCpy(iso_sup,iso_pri,DVD_BLK_SIZE);
|
||||||
|
iso_sup->type=ISO1T_SUPPLEMENTARY_DESC;
|
||||||
|
|
||||||
|
iso_boot->type=ISO1T_BOOT_RECORD;
|
||||||
|
StrCpy(iso_boot->id,"CD001");
|
||||||
|
iso_boot->version=1;
|
||||||
|
StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION");
|
||||||
|
|
||||||
|
FWBlks(out_file,iso_pri,16<<2,4);
|
||||||
|
iso_term->type=ISO1T_TERMINATOR;
|
||||||
|
StrCpy(iso_term->id,"CD001");
|
||||||
|
iso_term->version=1;
|
||||||
|
if (stage2_blk) {
|
||||||
|
d=iso_boot(U8 *)+0x47;
|
||||||
|
*d=20<<2>>2;
|
||||||
|
FWBlks(out_file,iso_boot,17<<2,4);
|
||||||
|
|
||||||
|
FWBlks(out_file,iso_sup,18<<2,4);
|
||||||
|
FWBlks(out_file,iso_term,19<<2,4);
|
||||||
|
|
||||||
|
et->w[0]=1;
|
||||||
|
StrCpy(&et->w[2],"TempleOS");
|
||||||
|
et->w[15]=0xAA55;
|
||||||
|
j=0;
|
||||||
|
for (i=0;i<16;i++) //Checksum
|
||||||
|
j+=et->w[i];
|
||||||
|
et->w[14]=-j;
|
||||||
|
et->bootable=0x88;
|
||||||
|
et->media_type=0;//0=no emu 2=1.44meg 4=hard drive
|
||||||
|
et->sect_cnt=4; //5 seems like the limit, 4 is safer
|
||||||
|
et->load_rba=20<<2>>2+1;
|
||||||
|
FWBlks(out_file,et,20<<2,4);
|
||||||
|
|
||||||
|
MemCpy(stage1_buf,BDVD_START,BDVD_END-BDVD_START);
|
||||||
|
*(BDVD_BLK_LO -BDVD_START+stage1_buf)(U32 *)=stage2_blk>>2;
|
||||||
|
*(BDVD_BLK_CNT -BDVD_START+stage1_buf)(U16 *)=
|
||||||
|
(stage2_size+DVD_BLK_SIZE-1)>>(BLK_SIZE_BITS+2);
|
||||||
|
*(BDVD_SHIFT_BLKS -BDVD_START+stage1_buf)(U16 *)=stage2_blk&3;
|
||||||
|
if (stage2_blk&3)
|
||||||
|
*(BDVD_BLK_CNT -BDVD_START+stage1_buf)(U16 *)+=1;
|
||||||
|
FWBlks(out_file,stage1_buf,
|
||||||
|
20<<2+1<<2,DVD_BOOT_LOADER_SIZE/BLK_SIZE);
|
||||||
|
} else {
|
||||||
|
FWBlks(out_file,iso_sup,17<<2,4);
|
||||||
|
FWBlks(out_file,iso_term,18<<2,4);
|
||||||
|
}
|
||||||
|
FClose(out_file);
|
||||||
|
}
|
||||||
|
Free(zero_buf);
|
||||||
|
Free(stage1_buf);
|
||||||
|
Free(et);
|
||||||
|
Free(iso_pri);
|
||||||
|
Free(iso_boot);
|
||||||
|
Free(iso_sup);
|
||||||
|
Free(iso_term);
|
||||||
|
}
|
||||||
|
|
||||||
|
I64 RedSeaISOPass1(CDirEntry *tempde)
|
||||||
|
{
|
||||||
|
I64 dir_entry_cnt=3+LinkedLstCnt(tempde),res=0;
|
||||||
|
while (tempde) {
|
||||||
|
if (tempde->attr & RS_ATTR_DIR) {
|
||||||
|
if (tempde->sub)
|
||||||
|
res+=RedSeaISOPass1(tempde->sub);
|
||||||
|
else
|
||||||
|
res+=BLK_SIZE; //Empty dir
|
||||||
|
} else
|
||||||
|
res+=CeilU64(tempde->size,BLK_SIZE);
|
||||||
|
tempde=tempde->next;
|
||||||
|
}
|
||||||
|
res+=CeilU64(dir_entry_cnt<<6,BLK_SIZE); //Size in bytes
|
||||||
|
#assert CDIR_SIZE==64
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
|
||||||
|
U8 *_stage2_filename=NULL)
|
||||||
|
{//See $LK,"::/Misc/DoDistro.CPP"$. Must be ISO.C
|
||||||
|
I64 i,res,root_cnt,root_dir_blks,bitmap_blks,bitmap_blks1;
|
||||||
|
CDirEntry *tempde,de;
|
||||||
|
U8 buf[STR_LEN],*iso_filename,*src_dir,*stage2_filename;
|
||||||
|
CDrv *dv=DrvNextFree('M'); //First $LK,"BDT_FILE",A="MN:BDT_FILE"$
|
||||||
|
CBlkDev *bd=BlkDevNextFree(dv->drv_let,BDT_FILE);
|
||||||
|
|
||||||
|
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 root
|
||||||
|
i++; //Skip slash
|
||||||
|
StrCpy(stage2_filename+3,stage2_filename+i);
|
||||||
|
} else
|
||||||
|
stage2_filename=NULL;
|
||||||
|
tempde=FilesFind(src_dir,FUF_RECURSE);
|
||||||
|
root_cnt=LinkedLstCnt(tempde)+3;
|
||||||
|
root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
|
||||||
|
if (res=RedSeaISOPass1(tempde)>>BLK_SIZE_BITS) {
|
||||||
|
bd->drv_offset=19<<2;
|
||||||
|
if (stage2_filename) //preboot and bootloader
|
||||||
|
bd->drv_offset+=(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);
|
||||||
|
if (FileFind(stage2_filename,&de))
|
||||||
|
RedSeaISO9660(iso_filename,dv->drv_let,de.cluster,de.size);
|
||||||
|
else
|
||||||
|
RedSeaISO9660(iso_filename,dv->drv_let);
|
||||||
|
DrvDel(dv);
|
||||||
|
BlkDevDel(bd);
|
||||||
|
}
|
||||||
|
Free(stage2_filename);
|
||||||
|
Free(src_dir);
|
||||||
|
Free(iso_filename);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
@@ -3,7 +3,8 @@ Cd(__DIR__);;
|
|||||||
#include "BootHD"
|
#include "BootHD"
|
||||||
#include "BootMHD"
|
#include "BootMHD"
|
||||||
#include "BootMHD2"
|
#include "BootMHD2"
|
||||||
#include "DskISOFile"
|
#include "DskISORedSea"
|
||||||
|
#include "DskISO9660"
|
||||||
#include "BootIns"
|
#include "BootIns"
|
||||||
#include "Reboot"
|
#include "Reboot"
|
||||||
Cd("..");;
|
Cd("..");;
|
||||||
@@ -43,6 +43,7 @@ public U0 RAMReboot(U8 *filename)
|
|||||||
while (sys_ram_reboot<0x100000);
|
while (sys_ram_reboot<0x100000);
|
||||||
|
|
||||||
hi_image->boot_src=BOOT_SRC_RAM;
|
hi_image->boot_src=BOOT_SRC_RAM;
|
||||||
|
hi_image->boot_blk=0;
|
||||||
hi_image->boot_patch_table_base=lo_image(U8 *)+hi_image->h.patch_table_offset;
|
hi_image->boot_patch_table_base=lo_image(U8 *)+hi_image->h.patch_table_offset;
|
||||||
hi_image->sys_run_level =lo_image->sys_run_level&(RLF_VGA|RLF_16BIT);
|
hi_image->sys_run_level =lo_image->sys_run_level&(RLF_VGA|RLF_16BIT);
|
||||||
MemCpy(&hi_image->start,&lo_image->start,
|
MemCpy(&hi_image->start,&lo_image->start,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ I64 DiffEntriesCompare(CDocEntry *doc_e1,CDocEntry *doc_e2)
|
|||||||
#define DF_ABORT_ALL_FILES 0x20
|
#define DF_ABORT_ALL_FILES 0x20
|
||||||
#define DF_NO_MORE_PMTS_THIS_FILE 0x40
|
#define DF_NO_MORE_PMTS_THIS_FILE 0x40
|
||||||
|
|
||||||
U0 DiffSelect(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,
|
U0 DiffSel(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,
|
||||||
I64 j2_lo,I64 j2_hi,I64 cnt1,I64 cnt2,
|
I64 j2_lo,I64 j2_hi,I64 cnt1,I64 cnt2,
|
||||||
CDocEntry **doc_unsorted1,CDocEntry **doc_unsorted2)
|
CDocEntry **doc_unsorted1,CDocEntry **doc_unsorted2)
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@ Bool DiffSub(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,I64 j2_lo,I64 j2_hi,
|
|||||||
|
|
||||||
if (j1_lo>=j1_hi || j2_lo>=j2_hi) {
|
if (j1_lo>=j1_hi || j2_lo>=j2_hi) {
|
||||||
if (j1_lo<j1_hi || j2_lo<j2_hi) {
|
if (j1_lo<j1_hi || j2_lo<j2_hi) {
|
||||||
DiffSelect(doc,_df_flags,j1_lo,j1_hi,j2_lo,j2_hi,cnt1,cnt2,
|
DiffSel(doc,_df_flags,j1_lo,j1_hi,j2_lo,j2_hi,cnt1,cnt2,
|
||||||
doc_unsorted1,doc_unsorted2);
|
doc_unsorted1,doc_unsorted2);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else
|
} else
|
||||||
@@ -202,7 +202,7 @@ Bool DiffSub(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,I64 j2_lo,I64 j2_hi,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!best_score) {
|
if (!best_score) {
|
||||||
DiffSelect(doc,_df_flags,j1_lo,j1_hi,j2_lo,j2_hi,cnt1,cnt2,
|
DiffSel(doc,_df_flags,j1_lo,j1_hi,j2_lo,j2_hi,cnt1,cnt2,
|
||||||
doc_unsorted1,doc_unsorted2);
|
doc_unsorted1,doc_unsorted2);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ I64 FindFile(U8 *needle_str,U8 *haystack_filename,
|
|||||||
cnt++;
|
cnt++;
|
||||||
if (first_on_line || Bt(_fuf_flags,FUf_REPLACE)) {
|
if (first_on_line || Bt(_fuf_flags,FUf_REPLACE)) {
|
||||||
first_on_line=FALSE;
|
first_on_line=FALSE;
|
||||||
PutFileLink(haystack_filename,doc_e->y+1,TRUE);
|
PutFileLink(haystack_filename,,doc_e->y+1,TRUE);
|
||||||
name_buf=MStrPrint("%s,%d",haystack_filename,doc_e->y+1);
|
name_buf=MStrPrint("%s,%d",haystack_filename,doc_e->y+1);
|
||||||
if (cur_l=DocPut) {
|
if (cur_l=DocPut) {
|
||||||
old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
|
old_flags=cur_l->flags&DOCF_PLAIN_TEXT;
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
|
|||||||
Fs->put_doc=old_doc;
|
Fs->put_doc=old_doc;
|
||||||
DocUnlock(old_doc);
|
DocUnlock(old_doc);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
PutFileLink(doc->filename.name,doc_e->y);
|
PutFileLink(doc->filename.name,,doc_e->y);
|
||||||
"$$RED$$ %04d:%s\n$$FG$$",doc_e->y,st;
|
"$$RED$$ %04d:%s\n$$FG$$",doc_e->y,st;
|
||||||
res++;
|
res++;
|
||||||
}
|
}
|
||||||
Free(st);
|
Free(st);
|
||||||
} else if (doc_e->type_u8==DOCT_ERROR) {
|
} else if (doc_e->type_u8==DOCT_ERROR) {
|
||||||
PutFileLink(doc->filename.name,doc_e->y);
|
PutFileLink(doc->filename.name,,doc_e->y);
|
||||||
"$$RED$$ Doc Error\n$$FG$$";
|
"$$RED$$ Doc Error\n$$FG$$";
|
||||||
res++;
|
res++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ U0 TXTPutS(CDoc *doc,U8 *st,I64 *_col)
|
|||||||
} while (*_col&7);
|
} while (*_col&7);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sub_switch_start:
|
start:
|
||||||
case 'ă': ptr="pi"; break;
|
case 'ă': ptr="pi"; break;
|
||||||
case 'é': ptr="theta"; break;
|
case 'é': ptr="theta"; break;
|
||||||
case 'č': ptr="phi"; break;
|
case 'č': ptr="phi"; break;
|
||||||
@@ -20,7 +20,7 @@ U0 TXTPutS(CDoc *doc,U8 *st,I64 *_col)
|
|||||||
case 'ě': ptr="inf"; break;
|
case 'ě': ptr="inf"; break;
|
||||||
case 'ć': ptr="u"; break;
|
case 'ć': ptr="u"; break;
|
||||||
case CH_SHIFT_SPACE: ptr=" "; break;
|
case CH_SHIFT_SPACE: ptr=" "; break;
|
||||||
sub_switch_end:
|
end:
|
||||||
DocPrint(doc,ptr);
|
DocPrint(doc,ptr);
|
||||||
*_col=*_col+StrLen(ptr);
|
*_col=*_col+StrLen(ptr);
|
||||||
break;
|
break;
|
||||||
|
|||||||
+2
-2
@@ -53,9 +53,9 @@ U0 KeyMapCtrlAltFamily(Bool no_shift,Bool shift)
|
|||||||
if (no_shift) KeyMapKeyPrint(SC_DELETE+SCF_CTRL+SCF_ALT+no_shift_f,
|
if (no_shift) KeyMapKeyPrint(SC_DELETE+SCF_CTRL+SCF_ALT+no_shift_f,
|
||||||
&Reboot,"Cmd /Reboot");
|
&Reboot,"Cmd /Reboot");
|
||||||
if (no_shift) KeyMapKeyPrint(SC_ESC+SCF_CTRL+SCF_ALT+no_shift_f,
|
if (no_shift) KeyMapKeyPrint(SC_ESC+SCF_CTRL+SCF_ALT+no_shift_f,
|
||||||
&User,"Cmd /Spawn New User Task");
|
&User,"Cmd /Terminal Window");
|
||||||
if (no_shift) KeyMapKeyPrint(SC_TAB+SCF_CTRL+SCF_ALT+no_shift_f,
|
if (no_shift) KeyMapKeyPrint(SC_TAB+SCF_CTRL+SCF_ALT+no_shift_f,
|
||||||
&WinToTop,"Cmd /Switch Focus to Next Task");
|
&WinToTop,"Cmd /Next Focus Task");
|
||||||
|
|
||||||
for (i=0;i<26;i++)
|
for (i=0;i<26;i++)
|
||||||
if (keydev.fp_ctrl_alt_cbs[i]) {
|
if (keydev.fp_ctrl_alt_cbs[i]) {
|
||||||
|
|||||||
+1
-1
@@ -104,7 +104,7 @@ U0 ExtendedASCII()
|
|||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
CDoc *doc=DocNew;
|
CDoc *doc=DocNew;
|
||||||
DocPrint(doc,"Select Char and Press <ESC>\n$$LTBLUE$$");
|
DocPrint(doc,"Sel Char and Press <ESC>\n$$LTBLUE$$");
|
||||||
for (i=0;i<256;i++) {
|
for (i=0;i<256;i++) {
|
||||||
if (i>=CH_SHIFT_SPACE && i!=0x7F) {
|
if (i>=CH_SHIFT_SPACE && i!=0x7F) {
|
||||||
if (i==CH_SHIFT_SPACE)
|
if (i==CH_SHIFT_SPACE)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ extern U0 BgtRegen();
|
|||||||
|
|
||||||
Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||||
{//ch=ASCII; sc=scan_code
|
{//ch=ASCII; sc=scan_code
|
||||||
nounusedwarn sc;
|
no_warn sc;
|
||||||
CBgtEntry *tempb,*tempb1;
|
CBgtEntry *tempb,*tempb1;
|
||||||
CBgtTemplate *tempt,*tempt1;
|
CBgtTemplate *tempt,*tempt1;
|
||||||
CDocEntry *doc_ce;
|
CDocEntry *doc_ce;
|
||||||
@@ -51,7 +51,7 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
|||||||
case 'a':
|
case 'a':
|
||||||
PopUpOk( "Set the name and color of your accounts.\n"
|
PopUpOk( "Set the name and color of your accounts.\n"
|
||||||
"To delete accounts, manually edit\n"
|
"To delete accounts, manually edit\n"
|
||||||
"$$GREEN$$/Home/Budget/Accts.TXT.Z$$FG$$.");
|
"$$GREEN$$~/Budget/Accts.TXT.Z$$FG$$.");
|
||||||
if (PopUpEd(BGT_ACCTS_FILE,Fs)) {
|
if (PopUpEd(BGT_ACCTS_FILE,Fs)) {
|
||||||
BgtAcctsRead;
|
BgtAcctsRead;
|
||||||
BgtRegen;
|
BgtRegen;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define BGT_STRINGS_FILE "::/Home/Budget/Strs.TXT.Z"
|
#define BGT_STRINGS_FILE "~/Budget/Strs.TXT.Z"
|
||||||
#define BGT_ACCTS_FILE "::/Home/Budget/Accts.TXT.Z"
|
#define BGT_ACCTS_FILE "~/Budget/Accts.TXT.Z"
|
||||||
#define BGT_DATA_FILE "::/Home/Budget/Bgt.DAT.Z"
|
#define BGT_DATA_FILE "~/Budget/Bgt.DAT.Z"
|
||||||
|
|
||||||
#define BE_NORMAL 0
|
#define BE_NORMAL 0
|
||||||
#define BE_GAS 1
|
#define BE_GAS 1
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Cd(__DIR__);;
|
Cd(__DIR__);;
|
||||||
if (!FileFind("::/Home/Budget",,FUF_JUST_DIRS)) {
|
if (!FileFind("~/Budget",,FUF_JUST_DIRS)) {
|
||||||
MkDir("::/Home/Budget");
|
MkDir("~/Budget");
|
||||||
Copy("Accts.TXT.Z","::/Home/Budget");
|
Copy("Accts.TXT.Z","~/Budget");
|
||||||
}
|
}
|
||||||
+70
-41
@@ -240,16 +240,17 @@ I64 score0,score1;
|
|||||||
|
|
||||||
#define NUM_PER_SIDE 3
|
#define NUM_PER_SIDE 3
|
||||||
#define NUM_OBJS (NUM_PER_SIDE*2+1)
|
#define NUM_OBJS (NUM_PER_SIDE*2+1)
|
||||||
Bool someone_shooting;
|
Bool someone_shooting,someone_has_ball;
|
||||||
|
F64 shot_land_t;
|
||||||
|
|
||||||
class Obj
|
class Obj
|
||||||
{
|
{
|
||||||
I64 team; //-1 is ball
|
I64 team; //-1 is ball
|
||||||
F64 x,y,z,DxDt,DyDt,DzDt,ay,radius,stolen_t0;
|
F64 x,y,z,DxDt,DyDt,DzDt,é,radius,stolen_t0;
|
||||||
F64 last_t0,next_t0,foul_t0;
|
F64 get_ball_dt,get_ball_é,nearest_man_dd,last_t0,next_t0,foul_t0;
|
||||||
I64 last_img,next_img;
|
I64 last_img,next_img;
|
||||||
Bool stopped,shooting,has_ball,pad[5];
|
Bool stopped,shooting,has_ball,nearest_ball,pad[4];
|
||||||
} objs[NUM_OBJS],*ball,*human;
|
} objs[NUM_OBJS],*ball,*human,*last_owner;
|
||||||
|
|
||||||
/*Just to be different, I didn't use the built-in
|
/*Just to be different, I didn't use the built-in
|
||||||
DCF_TRANSFORMATION flag in this game.
|
DCF_TRANSFORMATION flag in this game.
|
||||||
@@ -282,7 +283,7 @@ U0 DrawObj(CDC *dc,Obj *o,F64 tt)
|
|||||||
temps=SpriteInterpolate((tt-o->last_t0)/(o->next_t0-o->last_t0),
|
temps=SpriteInterpolate((tt-o->last_t0)/(o->next_t0-o->last_t0),
|
||||||
imgs[o->last_img].img[o->team],
|
imgs[o->last_img].img[o->team],
|
||||||
imgs[o->next_img].img[o->team]);
|
imgs[o->next_img].img[o->team]);
|
||||||
SpriteY3B(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,temps,o->ay);
|
SpriteY3B(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,temps,o->é);
|
||||||
Free(temps);
|
Free(temps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -316,9 +317,9 @@ U0 DrawIt(CTask *task,CDC *dc)
|
|||||||
o=o_sort[i]=&objs[i];
|
o=o_sort[i]=&objs[i];
|
||||||
if (o!=ball) {
|
if (o!=ball) {
|
||||||
if (o->has_ball) {
|
if (o->has_ball) {
|
||||||
ball->x=o->x+HAND_X_OFFSET*Cos(o->ay-ã/2)+HAND_Y_OFFSET*Cos(o->ay);
|
ball->x=o->x+HAND_X_OFFSET*Cos(o->é-ã/2)+HAND_Y_OFFSET*Cos(o->é);
|
||||||
//The factor 2 is because the man is not transformed.
|
//The factor 2 is because the man is not transformed.
|
||||||
ball->y=o->y+HAND_X_OFFSET*Sin(o->ay-ã/2)/2+HAND_Y_OFFSET*Sin(o->ay)/2;
|
ball->y=o->y+HAND_X_OFFSET*Sin(o->é-ã/2)/2+HAND_Y_OFFSET*Sin(o->é)/2;
|
||||||
if (ball->z+ball->radius*2>o->z+HAND_Z_OFFSET)
|
if (ball->z+ball->radius*2>o->z+HAND_Z_OFFSET)
|
||||||
ball->z=o->z+HAND_Z_OFFSET-ball->radius*2;
|
ball->z=o->z+HAND_Z_OFFSET-ball->radius*2;
|
||||||
} else if (o->shooting) {
|
} else if (o->shooting) {
|
||||||
@@ -355,10 +356,12 @@ U0 DrawIt(CTask *task,CDC *dc)
|
|||||||
o->next_img=FIRST_SHOOTING;
|
o->next_img=FIRST_SHOOTING;
|
||||||
if (o->next_img>LAST_SHOOTING) {
|
if (o->next_img>LAST_SHOOTING) {
|
||||||
o->next_img=FIRST_STANDING;
|
o->next_img=FIRST_STANDING;
|
||||||
someone_shooting=o->has_ball=o->shooting=FALSE;
|
someone_has_ball=someone_shooting=o->has_ball=o->shooting=FALSE;
|
||||||
ball->DxDt=o->DxDt+SHOT_VELOCITY/sqrt2*Cos(o->ay-ã/2);
|
ball->DxDt=o->DxDt+SHOT_VELOCITY/sqrt2*Cos(o->é-ã/2);
|
||||||
ball->DyDt=o->DyDt+SHOT_VELOCITY/sqrt2*Sin(o->ay-ã/2);
|
ball->DyDt=o->DyDt+SHOT_VELOCITY/sqrt2*Sin(o->é-ã/2);
|
||||||
ball->DzDt=o->DzDt+SHOT_VELOCITY/sqrt2;
|
ball->DzDt=o->DzDt+SHOT_VELOCITY/sqrt2;
|
||||||
|
shot_land_t=tt+(ball->DzDt+Sqrt(Sqr(ball->DzDt)+
|
||||||
|
2*GRAVITY_ACCELERATION*ball->z))/GRAVITY_ACCELERATION;
|
||||||
} else {
|
} else {
|
||||||
ball->DxDt=0;
|
ball->DxDt=0;
|
||||||
ball->DyDt=0;
|
ball->DyDt=0;
|
||||||
@@ -426,9 +429,9 @@ U0 Shoot(Obj *o)
|
|||||||
U0 AnimateTask(CTask *parent_task)
|
U0 AnimateTask(CTask *parent_task)
|
||||||
{
|
{
|
||||||
F64 d,dx,dy,dt,dx2,dy2,t0=tS;
|
F64 d,dx,dy,dt,dx2,dy2,t0=tS;
|
||||||
I64 i,j,team;
|
I64 i,j;
|
||||||
Bool gets_ball,ball_stolen;
|
Bool gets_ball;
|
||||||
Obj *o;
|
Obj *o,*nearest_ball[2];
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
dt=tS-t0;
|
dt=tS-t0;
|
||||||
t0=tS;
|
t0=tS;
|
||||||
@@ -444,10 +447,29 @@ U0 AnimateTask(CTask *parent_task)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game_t_end)
|
if (game_t_end) {
|
||||||
|
MemSet(&nearest_ball,0,sizeof(nearest_ball));
|
||||||
for (i=0;i<NUM_OBJS;i++) {
|
for (i=0;i<NUM_OBJS;i++) {
|
||||||
o=&objs[i];
|
o=&objs[i];
|
||||||
|
o->nearest_ball=FALSE;
|
||||||
|
if (o!=ball) {
|
||||||
|
d=0;
|
||||||
|
for (j=0;j<5;j++) //Iterative estimate of how long to get ball.
|
||||||
|
d=Sqrt(Sqr(ball->DxDt*d+ball->x-o->x)+
|
||||||
|
Sqr(ball->DyDt*d+ball->y-o->y))/MAN_VELOCITY;
|
||||||
|
o->get_ball_dt=d;
|
||||||
|
o->get_ball_é=Arg(ball->DxDt*d+ball->x-o->x,
|
||||||
|
ball->DyDt*d+ball->y-o->y);
|
||||||
|
if (o!=last_owner && !nearest_ball[o->team] ||
|
||||||
|
o->get_ball_dt<nearest_ball[o->team]->get_ball_dt)
|
||||||
|
nearest_ball[o->team]=o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nearest_ball[0]->nearest_ball=TRUE;
|
||||||
|
nearest_ball[1]->nearest_ball=TRUE;
|
||||||
|
|
||||||
|
for (i=0;i<NUM_OBJS;i++) {
|
||||||
|
o=&objs[i];
|
||||||
if (o==ball) {
|
if (o==ball) {
|
||||||
o->x+=dt*o->DxDt;
|
o->x+=dt*o->DxDt;
|
||||||
o->y+=dt*o->DyDt;
|
o->y+=dt*o->DyDt;
|
||||||
@@ -460,32 +482,31 @@ U0 AnimateTask(CTask *parent_task)
|
|||||||
dy=ball->y-o->y;
|
dy=ball->y-o->y;
|
||||||
if (dx*dx+dy*dy<HAND_SQR_OFFSET && ball->z<o->z+HAND_Z_OFFSET) {
|
if (dx*dx+dy*dy<HAND_SQR_OFFSET && ball->z<o->z+HAND_Z_OFFSET) {
|
||||||
gets_ball=TRUE;
|
gets_ball=TRUE;
|
||||||
ball_stolen=FALSE;
|
|
||||||
for (j=0;j<NUM_PER_SIDE*2;j++)
|
for (j=0;j<NUM_PER_SIDE*2;j++)
|
||||||
if (j!=i && objs[j].has_ball) {
|
if (j!=i && objs[j].has_ball) {
|
||||||
if (Rand<2.0*dt) {
|
if (Rand<2.0*dt) {
|
||||||
objs[j].stolen_t0=t0;
|
objs[j].stolen_t0=t0;
|
||||||
objs[j].has_ball=FALSE;
|
objs[j].has_ball=FALSE;
|
||||||
ball_stolen=TRUE;
|
|
||||||
team=objs[j].team;
|
|
||||||
} else
|
} else
|
||||||
gets_ball=FALSE;
|
gets_ball=FALSE;
|
||||||
}
|
}
|
||||||
if (gets_ball) {
|
if (gets_ball) {
|
||||||
o->has_ball=TRUE;
|
someone_has_ball=o->has_ball=TRUE;
|
||||||
if (o==human) {
|
if (o!=last_owner) {
|
||||||
if (ball_stolen && team) {
|
|
||||||
Noise(250,2000,2000);
|
|
||||||
score0+=2;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (o->team) {
|
if (o->team) {
|
||||||
Noise(250,1000,1000);
|
if (t0<shot_land_t+0.1)
|
||||||
|
score1+=6;
|
||||||
|
else
|
||||||
score1+=2;
|
score1+=2;
|
||||||
|
Noise(250,1000,1000);
|
||||||
} else {
|
} else {
|
||||||
Noise(250,2000,2000);
|
if (t0<shot_land_t+0.1)
|
||||||
|
score0+=6;
|
||||||
|
else
|
||||||
score0+=2;
|
score0+=2;
|
||||||
|
Noise(250,2000,2000);
|
||||||
}
|
}
|
||||||
|
last_owner=o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -496,20 +517,30 @@ U0 AnimateTask(CTask *parent_task)
|
|||||||
if (o==human) {
|
if (o==human) {
|
||||||
dx=(ip.pos.x-parent_task->pix_left-parent_task->scroll_x)-o->x;
|
dx=(ip.pos.x-parent_task->pix_left-parent_task->scroll_x)-o->x;
|
||||||
dy=(ip.pos.y-parent_task->pix_top-parent_task->scroll_y)*2-o->y;
|
dy=(ip.pos.y-parent_task->pix_top-parent_task->scroll_y)*2-o->y;
|
||||||
|
} else {
|
||||||
|
if (!someone_has_ball && o->nearest_man_dd>4*MAN_SQR_RADIUS &&
|
||||||
|
o->nearest_ball) {
|
||||||
|
dx=o->DxDt=MAN_VELOCITY*Cos(o->get_ball_é);
|
||||||
|
dy=o->DyDt=MAN_VELOCITY*Sin(o->get_ball_é);
|
||||||
} else {
|
} else {
|
||||||
dx=o->DxDt+=RANDOM_MAN_ACCELERATION/sqrt2*RandI16/MAX_I16*dt;
|
dx=o->DxDt+=RANDOM_MAN_ACCELERATION/sqrt2*RandI16/MAX_I16*dt;
|
||||||
dy=o->DyDt+=RANDOM_MAN_ACCELERATION/sqrt2*RandI16/MAX_I16*dt;
|
dy=o->DyDt+=RANDOM_MAN_ACCELERATION/sqrt2*RandI16/MAX_I16*dt;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
d=Sqrt(dx*dx+dy*dy);
|
d=Sqrt(dx*dx+dy*dy);
|
||||||
if (d>=1.0) {
|
if (d>=1.0) {
|
||||||
o->ay=Arg(dx,dy)+ã/2;
|
o->é=Arg(dx,dy)+ã/2;
|
||||||
dx*=MAN_VELOCITY/sqrt2*dt/d;
|
dx*=MAN_VELOCITY/sqrt2*dt/d;
|
||||||
dy*=MAN_VELOCITY/sqrt2*dt/d;
|
dy*=MAN_VELOCITY/sqrt2*dt/d;
|
||||||
|
o->nearest_man_dd=MAX_F64;
|
||||||
for (j=0;j<NUM_PER_SIDE*2;j++)
|
for (j=0;j<NUM_PER_SIDE*2;j++)
|
||||||
if (j!=i) {
|
if (j!=i) {
|
||||||
dx2=objs[j].x-o->x;
|
dx2=objs[j].x-o->x;
|
||||||
dy2=objs[j].y-o->y;
|
dy2=objs[j].y-o->y;
|
||||||
if ((d=Sqr(dx2)+Sqr(dy2))<MAN_SQR_RADIUS) {
|
d=Sqr(dx2)+Sqr(dy2);
|
||||||
|
if (d<o->nearest_man_dd)
|
||||||
|
o->nearest_man_dd=d;
|
||||||
|
if (d<MAN_SQR_RADIUS) {
|
||||||
if (d) {
|
if (d) {
|
||||||
d=Sqrt(d);
|
d=Sqrt(d);
|
||||||
dx2/=d;
|
dx2/=d;
|
||||||
@@ -584,7 +615,7 @@ U0 AnimateTask(CTask *parent_task)
|
|||||||
o->DzDt*=d;
|
o->DzDt*=d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
WinMgrSync;
|
WinMgrSync;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -593,6 +624,7 @@ U0 Init()
|
|||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
someone_shooting=FALSE;
|
someone_shooting=FALSE;
|
||||||
|
shot_land_t=0;
|
||||||
MemSet(&objs,0,sizeof(objs));
|
MemSet(&objs,0,sizeof(objs));
|
||||||
for (i=0;i<NUM_PER_SIDE*2;i++) {
|
for (i=0;i<NUM_PER_SIDE*2;i++) {
|
||||||
objs[i].team=i&1;
|
objs[i].team=i&1;
|
||||||
@@ -600,6 +632,7 @@ U0 Init()
|
|||||||
objs[i].y=2*Fs->pix_height/2;
|
objs[i].y=2*Fs->pix_height/2;
|
||||||
objs[i].next_img=objs[i].last_img=FIRST_RUNNING;
|
objs[i].next_img=objs[i].last_img=FIRST_RUNNING;
|
||||||
}
|
}
|
||||||
|
last_owner=NULL;
|
||||||
human=&objs[0];
|
human=&objs[0];
|
||||||
ball =&objs[i];
|
ball =&objs[i];
|
||||||
ball->team=-1;
|
ball->team=-1;
|
||||||
@@ -612,28 +645,26 @@ U0 Init()
|
|||||||
foul_t_end=0;
|
foul_t_end=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 CleanUp()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
U0 KeepAway()
|
U0 KeepAway()
|
||||||
{
|
{
|
||||||
I64 msg_code,a1,a2;
|
I64 msg_code,a1,a2;
|
||||||
|
|
||||||
PopUpOk(
|
PopUpOk(
|
||||||
"$$RED$$Pass or hand-off to score points.$$FG$$\n\n"
|
"Pass or hand-off to your team to score points.$$FG$$\n\n"
|
||||||
"Left-Click to pass.\n"
|
"\t2 points for successful hand-off.\n"
|
||||||
"Right-Click to jump.\n");
|
"\t6 points for successful pass.\n"
|
||||||
|
"\t1 point penalty for foul.\n\n"
|
||||||
|
"Left-Click\tto pass.\n\n"
|
||||||
|
"Right-Click\tto jump.\n");
|
||||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||||
Fs->text_attr=BLACK+YELLOW<<4;
|
Fs->text_attr=BLACK+YELLOW<<4;
|
||||||
|
Fs->win_inhibit|=WIG_DBL_CLICK;
|
||||||
AutoComplete;
|
AutoComplete;
|
||||||
WinBorder;
|
WinBorder;
|
||||||
WinMax;
|
WinMax;
|
||||||
DocCursor;
|
DocCursor;
|
||||||
DocClear;
|
DocClear;
|
||||||
|
|
||||||
Fs->win_inhibit|=WIG_DBL_CLICK;
|
|
||||||
|
|
||||||
MenuPush(
|
MenuPush(
|
||||||
"File {"
|
"File {"
|
||||||
" Abort(,CH_SHIFT_ESC);"
|
" Abort(,CH_SHIFT_ESC);"
|
||||||
@@ -666,7 +697,6 @@ ka_jump:
|
|||||||
case MSG_KEY_DOWN:
|
case MSG_KEY_DOWN:
|
||||||
switch (a1) {
|
switch (a1) {
|
||||||
case '\n':
|
case '\n':
|
||||||
CleanUp;
|
|
||||||
Init;
|
Init;
|
||||||
break;
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
@@ -687,7 +717,6 @@ ka_done: //Don't goto out of try
|
|||||||
SettingsPop;
|
SettingsPop;
|
||||||
RegWriteBranch("TempleOS/KeepAway","I64 best_score0=%d,best_score1=%d;\n",
|
RegWriteBranch("TempleOS/KeepAway","I64 best_score0=%d,best_score1=%d;\n",
|
||||||
best_score0,best_score1);
|
best_score0,best_score1);
|
||||||
CleanUp;
|
|
||||||
MenuPop;
|
MenuPop;
|
||||||
}
|
}
|
||||||
| |||||||