TempleOSCDV5.02.ISO
This commit is contained in:
1 parent
320c7ee98a
commit
4b32f058d5
137 files changed
+3474
-3293
No files matched your search
+14
-14
@@ -6,34 +6,34 @@ public U8 *DBlk(I64 blk,Bool write=FALSE)
|
||||
//See $LK,"::/Demo/Dsk/DskRaw.HC"$.
|
||||
U8 *buf=MAlloc(BLK_SIZE);
|
||||
|
||||
RBlks(Fs->cur_dv,buf,blk,1);
|
||||
BlkRead(Fs->cur_dv,buf,blk,1);
|
||||
DocD(buf,BLK_SIZE);
|
||||
if (write) {
|
||||
"Edit and press <ESC> to write or <SHIFT-ESC>\n";
|
||||
if (View) {
|
||||
"Write\n";
|
||||
WBlks(Fs->cur_dv,buf,blk,1);
|
||||
BlkWrite(Fs->cur_dv,buf,blk,1);
|
||||
}
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
public U8 *DCluster(I64 c,Bool write=FALSE,I64 num=0)
|
||||
{//Dump disk cluster. Optionally, write.
|
||||
//If you set write to TRUE, the cluster will
|
||||
public U8 *DClus(I64 c,Bool write=FALSE,I64 num=0)
|
||||
{//Dump disk clus. Optionally, write.
|
||||
//If you set write to TRUE, the clus will
|
||||
//be written when you press <ESC>.
|
||||
//See $LK,"::/Demo/Dsk/DskRaw.HC"$.
|
||||
//Do $LK,"Dir",A="MN:Dir"$("*",TRUE); to get cluster numbers of files.
|
||||
//Do $LK,"Dir",A="MN:Dir"$("*",TRUE); to get clus numbers of files.
|
||||
U8 *buf=MAlloc(Fs->cur_dv->spc<<BLK_SIZE_BITS);
|
||||
c=ClusterNumNext(Fs->cur_dv,c,num);
|
||||
RClusters(Fs->cur_dv,buf,c,1);
|
||||
"Cluster:%X\n",c;
|
||||
c=ClusNumNext(Fs->cur_dv,c,num);
|
||||
ClusRead(Fs->cur_dv,buf,c,1);
|
||||
"Clus:%X\n",c;
|
||||
DocD(buf,Fs->cur_dv->spc<<BLK_SIZE_BITS);
|
||||
if (write) {
|
||||
"Edit and press <ESC> to write or <SHIFT-ESC>\n";
|
||||
if (View) {
|
||||
"Write\n";
|
||||
WClusters(Fs->cur_dv,buf,c,1);
|
||||
ClusWrite(Fs->cur_dv,buf,c,1);
|
||||
}
|
||||
}
|
||||
return buf;
|
||||
@@ -67,7 +67,7 @@ public Bool Copy(U8 *src_files_find_mask,U8 *dst_files_find_mask=".")
|
||||
CDirContext *dirc;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
U8 *st;
|
||||
if (!(tmpde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
|
||||
if (!(tmpde1=FilesFind(src_files_find_mask,FUF_CLUS_ORDER)))
|
||||
return FALSE;
|
||||
if (IsDir(dst_files_find_mask)) {
|
||||
if (dirc=DirContextNew(dst_files_find_mask,TRUE)) {
|
||||
@@ -109,7 +109,7 @@ I64 CopyTree2(CDirEntry *tmpde,I64 src_dir_len,I64 dst_dir_len,U8 *dst_dir)
|
||||
MemCpy(st,dst_dir,dst_dir_len);
|
||||
StrCpy(st+dst_dir_len,tmpde->full_name+src_dir_len);
|
||||
if (tmpde->attr & RS_ATTR_DIR) {
|
||||
MkDir(st,LinkedLstCnt(tmpde->sub));
|
||||
DirMk(st,LinkedLstCnt(tmpde->sub));
|
||||
res+=CopyTree2(tmpde->sub,src_dir_len,dst_dir_len,dst_dir);
|
||||
} else
|
||||
if (CopySingle(tmpde->full_name,st))
|
||||
@@ -140,12 +140,12 @@ public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
|
||||
Free(st2);
|
||||
if (dirc=DirContextNew(src_files_find_mask,TRUE,,no_mask)) {
|
||||
tmpde=FilesFind(dirc->mask,FUF_RECURSE);
|
||||
st1=CurDir;
|
||||
st1=DirCur;
|
||||
DirContextDel(dirc);
|
||||
i1=StrLen(st1);
|
||||
if (i1==3) i1--;
|
||||
if (dirc=DirContextNew(dst_files_find_mask,TRUE,TRUE)) {
|
||||
st2=CurDir;
|
||||
st2=DirCur;
|
||||
i2=StrLen(st2);
|
||||
if (i2==3) i2--;
|
||||
res=CopyTree2(tmpde,i1,i2,st2);
|
||||
|
||||
@@ -87,7 +87,7 @@ I64 Size1(CDirEntry *tmpde,I64 *_fuf_flags,I64 round_to)
|
||||
!(tmpde->attr&RS_ATTR_DIR) &&
|
||||
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
|
||||
dv=Let2Drv(*tmpde->full_name);
|
||||
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
|
||||
BlkRead(dv,buf,Clus2Blk(dv,tmpde->clus),1);
|
||||
i=(&buf)(CArcCompress *)->expanded_size;
|
||||
}
|
||||
if (round_to)
|
||||
|
||||
@@ -21,20 +21,20 @@ I64 RedSeaChkDskLst(CDrv *dv,CDirEntry *tmpde1,
|
||||
errs+=RedSeaChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
|
||||
j=(tmpde1->size+bpc-1)/bpc;
|
||||
for (i=0;i<j;i++) {
|
||||
if (i+tmpde1->cluster-dv->data_area>size) {
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->cluster);
|
||||
if (i+tmpde1->clus-dv->data_area>size) {
|
||||
PrintErr("Invalid Clus:%s Clus:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->clus);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,i+tmpde1->cluster-dv->data_area)) {
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->cluster);
|
||||
if (LBts(bits,i+tmpde1->clus-dv->data_area)) {
|
||||
PrintErr("Dbl Alloc:%s Clus:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->clus);
|
||||
errs++;
|
||||
}
|
||||
if (!LBtr(bits2,i+tmpde1->cluster-dv->data_area)) {
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->cluster);
|
||||
if (!LBtr(bits2,i+tmpde1->clus-dv->data_area)) {
|
||||
PrintErr("UnAlloc:%s Clus:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->clus);
|
||||
errs++;
|
||||
}
|
||||
}
|
||||
@@ -59,27 +59,27 @@ I64 RedSeaChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
bpc=dv->spc<<BLK_SIZE_BITS;
|
||||
bits=CAlloc((size+7)>>3);
|
||||
bits2=CAlloc((size+7)>>3+BLK_SIZE);
|
||||
RBlks(dv,bits2,dv->fat1,((size+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS);
|
||||
BlkRead(dv,bits2,dv->fat1,((size+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS);
|
||||
|
||||
//Get Root Dir size
|
||||
ptr2=MAlloc(bpc);
|
||||
RBlks(dv,ptr2,dv->root_cluster,1);
|
||||
BlkRead(dv,ptr2,dv->root_clus,1);
|
||||
ptr=ptr2(U8 *)-offset(CDirEntry.start);
|
||||
j=(ptr->size+bpc-1)/bpc;
|
||||
Free(ptr2);
|
||||
|
||||
for (i=0;i<j;i++) {
|
||||
if (i+dv->root_cluster-dv->data_area>size) {
|
||||
PrintErr("Invalid Cluster: RootDir Cluster:%X\n",i+dv->root_cluster);
|
||||
if (i+dv->root_clus-dv->data_area>size) {
|
||||
PrintErr("Invalid Clus: RootDir Clus:%X\n",i+dv->root_clus);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,i+dv->root_cluster-dv->data_area)) {
|
||||
PrintErr("Dbl Alloc: RootDir Cluster:%X\n",i+dv->root_cluster);
|
||||
if (LBts(bits,i+dv->root_clus-dv->data_area)) {
|
||||
PrintErr("Dbl Alloc: RootDir Clus:%X\n",i+dv->root_clus);
|
||||
errs++;
|
||||
}
|
||||
if (!LBtr(bits2,i+dv->root_cluster-dv->data_area)) {
|
||||
PrintErr("UnAlloc: RootDir Cluster:%X\n",i+dv->root_cluster);
|
||||
if (!LBtr(bits2,i+dv->root_clus-dv->data_area)) {
|
||||
PrintErr("UnAlloc: RootDir Clus:%X\n",i+dv->root_clus);
|
||||
errs++;
|
||||
}
|
||||
}
|
||||
@@ -88,10 +88,10 @@ I64 RedSeaChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
bits,bits2,size,bpc);
|
||||
for (i=1;i<size;i++)
|
||||
if (Bt(bits2,i)) {
|
||||
PrintWarn("Shouldn't Alloc Cluster:%0X\n",i+dv->data_area);
|
||||
PrintWarn("Shouldn't Alloc Clus:%0X\n",i+dv->data_area);
|
||||
errs++;
|
||||
if (ChkDskConfirm(_fix,_confirm))
|
||||
RedSeaFreeClusters(dv,i+dv->data_area,1);
|
||||
RedSeaFreeClus(dv,i+dv->data_area,1);
|
||||
}
|
||||
|
||||
Free(files_find_mask);
|
||||
@@ -113,23 +113,23 @@ I64 FAT32ChkDskLst(CDrv *dv,CDirEntry *tmpde1,
|
||||
if (tmpde1->attr & RS_ATTR_DIR && tmpde1->sub)
|
||||
errs+=FAT32ChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
|
||||
i=0;
|
||||
c=tmpde1->cluster;
|
||||
c=tmpde1->clus;
|
||||
while (0<c<0x0FFFFFF8) {
|
||||
if (c>size) {
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tmpde1->full_name,c);
|
||||
PrintErr("Invalid Clus:%s Clus:%X\n",tmpde1->full_name,c);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,c)) {
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tmpde1->full_name,c);
|
||||
PrintErr("Dbl Alloc:%s Clus:%X\n",tmpde1->full_name,c);
|
||||
errs++;
|
||||
}
|
||||
if (!bits2[c]) {
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tmpde1->full_name,c);
|
||||
PrintErr("UnAlloc:%s Clus:%X\n",tmpde1->full_name,c);
|
||||
errs++;
|
||||
} else
|
||||
bits2[c]=0;
|
||||
c=ClusterNumNext(dv,c);
|
||||
c=ClusNumNext(dv,c);
|
||||
i++;
|
||||
}
|
||||
if (!(tmpde1->attr & RS_ATTR_DIR)) {
|
||||
@@ -163,25 +163,25 @@ I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
bpc=dv->spc<<BLK_SIZE_BITS;
|
||||
bits=CAlloc((size+7)>>3);
|
||||
bits2=CAlloc(size*4+BLK_SIZE);
|
||||
RBlks(dv,bits2,dv->fat1,(size*4+BLK_SIZE-1)>>BLK_SIZE_BITS);
|
||||
BlkRead(dv,bits2,dv->fat1,(size*4+BLK_SIZE-1)>>BLK_SIZE_BITS);
|
||||
|
||||
c=dv->root_cluster;
|
||||
c=dv->root_clus;
|
||||
while (0<c<0x0FFFFFF8) {
|
||||
if (c>size) {
|
||||
PrintErr("Invalid Cluster: RootDir Cluster:%X\n",c);
|
||||
PrintErr("Invalid Clus: RootDir Clus:%X\n",c);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,c)) {
|
||||
PrintErr("Dbl Alloc: RootDir Cluster:%X\n",c);
|
||||
PrintErr("Dbl Alloc: RootDir Clus:%X\n",c);
|
||||
errs++;
|
||||
}
|
||||
if (!bits2[c]) {
|
||||
PrintErr("UnAlloc: RootDir Cluster:%X\n",c);
|
||||
PrintErr("UnAlloc: RootDir Clus:%X\n",c);
|
||||
errs++;
|
||||
} else
|
||||
bits2[c]=0;
|
||||
c=ClusterNumNext(dv,c);
|
||||
c=ClusNumNext(dv,c);
|
||||
}
|
||||
|
||||
errs+=FAT32ChkDskLst(dv,FilesFind(files_find_mask,FUF_RECURSE),
|
||||
@@ -190,10 +190,10 @@ I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
bits2[1]=0; //See $LK,"FAT32Fmt",A="MN:FAT32Fmt"$()
|
||||
for (i=1;i<size;i++)
|
||||
if (bits2[i]) {
|
||||
PrintWarn("Shouldn't Alloc Cluster:%0X\n",i);
|
||||
PrintWarn("Shouldn't Alloc Clus:%0X\n",i);
|
||||
errs++;
|
||||
if (ChkDskConfirm(_fix,_confirm))
|
||||
FAT32FreeClusters(dv,i);
|
||||
FAT32FreeClus(dv,i);
|
||||
}
|
||||
Free(files_find_mask);
|
||||
Free(bits);
|
||||
@@ -204,7 +204,7 @@ I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
return errs;
|
||||
}
|
||||
|
||||
public I64 ChkDsk(U8 drv_let=0,Bool fix=FALSE,Bool confirm=TRUE)
|
||||
public I64 DskChk(U8 drv_let=0,Bool fix=FALSE,Bool confirm=TRUE)
|
||||
{//Check disk for allocation errors and, optionally, fix.
|
||||
//You probably want to reformat and reinstall.
|
||||
I64 errs=0;
|
||||
@@ -246,7 +246,7 @@ U0 RedSeaDrvView(U8 drv_let=0)
|
||||
try {
|
||||
i=((s+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
||||
RBlks(dv,bitmap,dv->fat1,i);
|
||||
BlkRead(dv,bitmap,dv->fat1,i);
|
||||
i=0;
|
||||
for (y=0;y<GR_HEIGHT-3*FONT_HEIGHT;y++) {
|
||||
if (ScanKey)
|
||||
@@ -288,7 +288,7 @@ U0 FAT32DrvView(U8 drv_let=0)
|
||||
try {
|
||||
i=(s*4+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
||||
RBlks(dv,bitmap,dv->fat1,i);
|
||||
BlkRead(dv,bitmap,dv->fat1,i);
|
||||
i=0;
|
||||
for (y=0;y<GR_HEIGHT-3*FONT_HEIGHT;y++) {
|
||||
if (ScanKey)
|
||||
@@ -394,7 +394,7 @@ I64 RedSeaUnusedDrvSpace(U8 drv_let=0)
|
||||
l=dv->size+dv->drv_offset-dv->data_area;
|
||||
i=((l+7)>>3+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
||||
RBlks(dv,bitmap,dv->fat1,i);
|
||||
BlkRead(dv,bitmap,dv->fat1,i);
|
||||
for (i=0;i<l;i++)
|
||||
if (!Bt(bitmap,i))
|
||||
res++;
|
||||
@@ -412,7 +412,7 @@ I64 FAT32UnusedDrvSpace(U8 drv_let=0)
|
||||
l=(dv->size+dv->spc-1)/dv->spc-(2+dv->data_area-dv->drv_offset);
|
||||
i=(l*4+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||
bitmap=MAlloc(i<<BLK_SIZE_BITS);
|
||||
RBlks(dv,bitmap,dv->fat1,i);
|
||||
BlkRead(dv,bitmap,dv->fat1,i);
|
||||
for (i=0;i<l;i++)
|
||||
if (!bitmap[i])
|
||||
res++;
|
||||
@@ -421,7 +421,7 @@ I64 FAT32UnusedDrvSpace(U8 drv_let=0)
|
||||
DrvUnlock(dv);
|
||||
return res*BLK_SIZE*dv->spc;
|
||||
}
|
||||
public I64 UnusedDrvSpace(U8 drv_let=0)
|
||||
public I64 DrvUnused(U8 drv_let=0)
|
||||
{//Returns unused size in bytes.
|
||||
CDrv *dv=Let2Drv(drv_let),*old_dv=Fs->cur_dv;
|
||||
U8 *old_dir=StrNew(Fs->cur_dir);
|
||||
@@ -10,12 +10,12 @@ class CPlannedDrv
|
||||
Bool pri;
|
||||
};
|
||||
|
||||
public I64 PrtDsk(U8 drv_let=0,...)
|
||||
public I64 DskPrt(U8 drv_let=0,...)
|
||||
{/*Partition the disk containing partition drv_let.
|
||||
|
||||
drv_let=0 means add new drive that is not already mounted.
|
||||
|
||||
>PrtDsk('C',0.5,0.25,0.25); //Make three. 50% C, 25% D, 25% E, round-up to blk.
|
||||
>DskPrt('C',0.5,0.25,0.25); //Make three. 50% C, 25% D, 25% E, round-up to blk.
|
||||
|
||||
*/
|
||||
CBlkDev *bd;
|
||||
@@ -145,7 +145,7 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
||||
{
|
||||
CDrv *dv;
|
||||
I64 i;
|
||||
CDoc *doc=*_doc,*doc2=sys_clipboard_doc,*parent_doc;
|
||||
CDoc *doc=*_doc,*doc2=sys_clip_doc,*parent_doc;
|
||||
CFMUncollapsedLst *tmpc=NULL;
|
||||
U8 *cur_entry=NULL,*next_entry=NULL;
|
||||
CDocEntry *doc_ce;
|
||||
@@ -284,7 +284,7 @@ U0 FMMkDir(CDoc *doc)
|
||||
Cd(parent->full_name);
|
||||
if (DocForm(&fn)) {
|
||||
Silent;
|
||||
MkDir(fn.name);
|
||||
DirMk(fn.name);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,7 @@ U0 FMMkDir(CDoc *doc)
|
||||
Cd(tmpde->full_name);
|
||||
if (DocForm(&fn)) {
|
||||
Silent;
|
||||
MkDir(fn.name);
|
||||
DirMk(fn.name);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
@@ -335,7 +335,7 @@ U0 FMChgDsk(CDoc *doc)
|
||||
while (tmpde->parent)
|
||||
tmpde=tmpde->parent;
|
||||
Silent;
|
||||
ChgDsk(*tmpde->full_name);
|
||||
DskChg(*tmpde->full_name);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
@@ -439,7 +439,7 @@ U0 FMBurnISO(CDoc *doc)
|
||||
|
||||
U0 FMCopy(CDoc *doc)
|
||||
{
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
CDoc *doc2=sys_clip_doc;
|
||||
U8 *st;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
CDirEntry *tmpde,*tmpde1=NULL,*tmpde2;
|
||||
@@ -511,7 +511,7 @@ I64 PopUpFMRight(U8 *header=NULL,U8 *footer=NULL)
|
||||
"$$CM+LX,29,0$$$$BT,\"RENAME \",LE=FMR_RENAME$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"MAKE DIRECTORY \",LE=FMR_MKDIR$$"
|
||||
"$$CM+LX,29,0$$$$BT,\"PLAIN-TEXT EDIT \",LE=FMR_PLAIN$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"PASTE CLIPBOARD FILES \",LE=FMR_PASTE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"PASTE CLIP FILES \",LE=FMR_PASTE$$"
|
||||
"$$CM+LX,29,0$$$$BT,\"CHANGE DISK(MOUNT IT) \",LE=FMR_CHG_DSK$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"FORMAT \",LE=FMR_FORMAT$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"MOUNT ISO.C FILE \","
|
||||
@@ -596,7 +596,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
CDirEntry *head=NULL,*tmpde,*tmpde1,*tmpde2;
|
||||
I64 sc,ch,arg1,arg2,msg_code;
|
||||
CDoc *doc=NULL,*old_put_doc=DocPut,*old_display_doc=DocDisplay;
|
||||
U8 *res=NULL,*st,*st2,*old_cur_dir=CurDir;
|
||||
U8 *res=NULL,*st,*st2,*old_cur_dir=DirCur;
|
||||
CDocEntry *doc_ce=NULL,*doc_e;
|
||||
Bool okay;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Cd(__DIR__);;
|
||||
#include "ADskA"
|
||||
#include "ADskB"
|
||||
#include "PrtDsk"
|
||||
#include "DskPrt"
|
||||
#include "Mount"
|
||||
#include "ChkDsk"
|
||||
#include "DskChk"
|
||||
#include "FileMgr"
|
||||
Cd("..");;
|
||||
@@ -120,9 +120,9 @@ U8 Mount2(U8 boot_drv_let,CDoc *_doc,Bool _caller_is_prtdsk)
|
||||
if ((cnt=ExeDoc(doc)) && whole_drv) {
|
||||
if (_caller_is_prtdsk) {
|
||||
res=drv_let;
|
||||
PrtDsk(drv_let,1.0); //First mount whole drive.
|
||||
DskPrt(drv_let,1.0); //First mount whole drive.
|
||||
} else
|
||||
PrtDsk(drv_let);
|
||||
DskPrt(drv_let);
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ U8 Mount2(U8 boot_drv_let,CDoc *_doc,Bool _caller_is_prtdsk)
|
||||
}
|
||||
|
||||
public U8 Mount(Bool caller_is_prtdsk=FALSE)
|
||||
{//Mount drives. Called from $LK,"PrtDsk(Mount)",A="FF:::/Adam/ABlkDev/PrtDsk.HC,Mount("$.
|
||||
{//Mount drives. Called from $LK,"DskPrt(Mount)",A="FF:::/Adam/ABlkDev/DskPrt.HC,Mount("$.
|
||||
return Mount2(0,NULL,caller_is_prtdsk);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ public U0 Unmount(U8 drv_let=0)
|
||||
|
||||
public U8 MountFile(U8 *filename)
|
||||
{//Mount ISO.C file.
|
||||
U8 *filename2=DftExt(filename,"ISO.C"),*filename3=FileNameAbs(filename2);
|
||||
U8 *filename2=ExtDft(filename,"ISO.C"),*filename3=FileNameAbs(filename2);
|
||||
CDrv *dv=DrvMakeFreeSlot(DrvNextFreeLet('M')); //First $LK,"BDT_ISO_FILE_READ",A="MN:BDT_ISO_FILE_READ"$
|
||||
CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_READ);
|
||||
bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
|
||||
|
||||
+5
-4
@@ -10,16 +10,17 @@ U0 LoadDocDefines()
|
||||
|
||||
//This is cut and replaced when I generate a distro.
|
||||
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOS/TOSDistro.HC,DD_TEMPLEOS_LOC"$.
|
||||
$TR-C,"LineRep"$
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,710");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,944");
|
||||
$ID,-4$
|
||||
|
||||
DefinePrint("DD_KERNEL","%08X",bfh);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
DefinePrint("DD_KERNEL_END","%08X",bfh);
|
||||
|
||||
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$
|
||||
|
||||
$TR-C,"LineRep"$
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,873");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,990");
|
||||
$ID,-4$
|
||||
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
|
||||
DefinePrint("DD_MP_VECT_END","%08X",
|
||||
MP_VECT_ADDR+COREAP_16BIT_INIT_END-COREAP_16BIT_INIT-1);
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ extern U0 ACMisspelledFind(CDoc *doc);
|
||||
extern I64 AdamFile(U8 *filename,Bool warn_ext=TRUE);
|
||||
extern Bool AutoComplete(Bool val=OFF);
|
||||
extern I64 BMPWrite(U8 *filename,CDC *dc,I64 bits=4);
|
||||
extern U0 ClipboardDel();
|
||||
extern U0 ClipDel();
|
||||
extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
|
||||
extern Bool CtrlInside(CCtrl *c,I64 x,I64 y);
|
||||
extern U8 *DC2Sprite(CDC *tmpb);
|
||||
|
||||
+1
-1
@@ -373,7 +373,7 @@ public U0 PopUpHelpIndex(U8 *idx,CTask *parent=NULL)
|
||||
#help_index "Hash/System"
|
||||
public U0 MapFileLoad(U8 *filename)
|
||||
{//Load map file so we have src line info.
|
||||
U8 *st,*ptr,*name=DftExt(filename,"MAP.Z"),
|
||||
U8 *st,*ptr,*name=ExtDft(filename,"MAP.Z"),
|
||||
*absname=FileNameAbs(name);
|
||||
CDoc *doc=DocRead(name);
|
||||
CDocEntry *doc_e;
|
||||
|
||||
+6
-32
@@ -43,26 +43,14 @@ public Bool RegDft(U8 *path,U8 *val,Bool is_adam_entry=FALSE)
|
||||
public I64 RegExe(U8 *path)
|
||||
{//Execute doc tree branch in registry.
|
||||
RegCache;
|
||||
return DocTreeBranchExe(sys_registry_doc,path);
|
||||
return DocTreeExe(sys_registry_doc,path);
|
||||
}
|
||||
|
||||
public Bool RegWrite(U8 *path,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch in registry.
|
||||
Bool res,unlock_doc;
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
Bool res;
|
||||
RegCache;
|
||||
unlock_doc=DocLock(sys_registry_doc);
|
||||
if (res=DocTreeFind(sys_registry_doc,path,
|
||||
&tree_branch,&start_indent,&end_indent))
|
||||
DocCut(sys_registry_doc,tree_branch,end_indent);
|
||||
DocTreeMake(sys_registry_doc,path);
|
||||
DocPrint(sys_registry_doc,"%s",buf);
|
||||
if (DrvIsWritable(*sys_registry_doc->filename.name))
|
||||
DocWrite(sys_registry_doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(sys_registry_doc);
|
||||
Free(buf);
|
||||
res=DocTreeWriteJoin(sys_registry_doc,path,TRUE,fmt,argc,argv);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -85,24 +73,10 @@ public I64 RegCnt(U8 *path)
|
||||
}
|
||||
|
||||
public Bool RegAppend(U8 *path,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch in registry.
|
||||
Bool res,unlock_doc;
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
{//Append to doc tree branch in registry.
|
||||
Bool res;
|
||||
RegCache;
|
||||
unlock_doc=DocLock(sys_registry_doc);
|
||||
if (res=DocTreeFind(sys_registry_doc,path,
|
||||
&tree_branch,&start_indent,&end_indent)) {
|
||||
sys_registry_doc->cur_entry=end_indent;
|
||||
sys_registry_doc->cur_col=sys_registry_doc->cur_entry->min_col;
|
||||
} else
|
||||
DocTreeMake(sys_registry_doc,path);
|
||||
DocPrint(sys_registry_doc,"%s",buf);
|
||||
if (DrvIsWritable(*sys_registry_doc->filename.name))
|
||||
DocWrite(sys_registry_doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(sys_registry_doc);
|
||||
Free(buf);
|
||||
res=DocTreeAppendJoin(sys_registry_doc,path,TRUE,fmt,argc,argv);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public U8 *ACDDefGet(U8 *st,I64 def_num=1)
|
||||
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
||||
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
||||
buf[ACD_BLK_SIZE*2]=0; //terminate
|
||||
FRBlks(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
FBlkRead(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
ACD_BLK_SIZE*2/BLK_SIZE);
|
||||
FClose(f);
|
||||
in_ptr=buf;
|
||||
@@ -55,7 +55,7 @@ public U8 *ACDDefsGet(U8 *st)
|
||||
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
||||
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
||||
buf[ACD_BLK_SIZE*2]=0; //terminate
|
||||
FRBlks(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
FBlkRead(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
ACD_BLK_SIZE*2/BLK_SIZE);
|
||||
FClose(f);
|
||||
in_ptr=buf;
|
||||
|
||||
@@ -96,7 +96,7 @@ U0 ACMainFileLstTraverse(U8 *files_find_mask)
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
try {
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,
|
||||
FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES|FUF_CLUSTER_ORDER);
|
||||
FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES|FUF_CLUS_ORDER);
|
||||
while (tmpde) {
|
||||
"%s\n",tmpde->full_name;
|
||||
buf=FileRead(tmpde->full_name);
|
||||
|
||||
@@ -222,8 +222,7 @@ U0 ACTask(I64)
|
||||
LBts(&Fs->display_flags,DISPLAYf_SHOW);
|
||||
WinHorz(51,Fs->win_right);
|
||||
LBts(&Fs->display_flags,DISPLAYf_WIN_ON_TOP);
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER
|
||||
-WIF_SELF_MS_L-WIF_SELF_MS_R-WIG_DBL_CLICK;
|
||||
Fs->win_inhibit=WIG_NO_FOCUS_TASK_DFT;
|
||||
Free(ac.cur_word);
|
||||
ac.cur_word=NULL;
|
||||
while (TRUE) {
|
||||
|
||||
+38
-36
@@ -1,19 +1,19 @@
|
||||
#help_index "DolDoc/Clipboard"
|
||||
#help_index "DolDoc/Clip"
|
||||
|
||||
sys_clipboard_doc=DocNew;
|
||||
sys_clip_doc=DocNew;
|
||||
|
||||
public U0 ClipboardDel()
|
||||
{//Delete everything on clipboard.
|
||||
DocRst(sys_clipboard_doc,TRUE);
|
||||
public U0 ClipDel()
|
||||
{//Delete everything on clip.
|
||||
DocRst(sys_clip_doc,TRUE);
|
||||
}
|
||||
|
||||
public U0 EdCopyToClipboard(CDoc *doc)
|
||||
{//Copy $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ flagged entries to clipboard.
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
public U0 ClipCopy(CDoc *doc)
|
||||
{//Copy $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ flagged entries to clip.
|
||||
CDoc *doc2=sys_clip_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_e=doc->head.next,*doc_ne;
|
||||
ClipboardDel;
|
||||
ClipDel;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type & DOCET_SEL) {
|
||||
doc_e->type&=~DOCET_SEL;
|
||||
@@ -30,13 +30,13 @@ public U0 EdCopyToClipboard(CDoc *doc)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
public U0 EdCutToClipboard(CDoc *doc)
|
||||
{//Remove sel entries and place on clipboard.
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
public U0 ClipCut(CDoc *doc)
|
||||
{//Remove sel entries and place on clip.
|
||||
CDoc *doc2=sys_clip_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e1,*doc_ne,*doc_e2=NULL;
|
||||
ClipboardDel;
|
||||
ClipDel;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (doc_e->type & DOCET_SEL) {
|
||||
@@ -62,9 +62,9 @@ public U0 EdCutToClipboard(CDoc *doc)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
public U0 EdPasteClipboard(CDoc *doc)
|
||||
{//Insert copy of clipboard at insert pt, cur_entry.
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
public U0 ClipPaste(CDoc *doc)
|
||||
{//Insert copy of clip at insert pt, cur_entry.
|
||||
CDoc *doc2=sys_clip_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
@@ -87,17 +87,18 @@ public U0 DocCut(CDoc *doc,CDocEntry *start,CDocEntry *end)
|
||||
{//Del start to end entry, including end points.
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_e1;
|
||||
while (start!=doc) {
|
||||
doc_e1=start->next;
|
||||
if (start==doc->cur_entry) {
|
||||
doc->cur_entry=start->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
DocEntryDel(doc,start);
|
||||
if (start==end)
|
||||
break;
|
||||
start=doc_e1;
|
||||
}
|
||||
if (start!=doc && (start->last!=end || end==doc))
|
||||
do {
|
||||
doc_e1=start->next;
|
||||
if (start==doc->cur_entry) {
|
||||
doc->cur_entry=start->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
DocEntryDel(doc,start);
|
||||
if (start==end)
|
||||
break;
|
||||
start=doc_e1;
|
||||
} while (start!=doc);
|
||||
DocRemSoftNewLines(doc,NULL);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
@@ -108,15 +109,16 @@ public CDoc *DocCopy(CDoc *doc,CDocEntry *start,CDocEntry *end)
|
||||
CDoc *doc2=DocNew;
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_ne;
|
||||
while (start!=doc) {
|
||||
if (!Bt(doldoc.type_flags_data,start->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,start);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (start==end)
|
||||
break;
|
||||
start=start->next;
|
||||
}
|
||||
if (start!=doc && (start->last!=end || end==doc))
|
||||
do {
|
||||
if (!Bt(doldoc.type_flags_data,start->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,start);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (start==end)
|
||||
break;
|
||||
start=start->next;
|
||||
} while (start!=doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
return doc2;
|
||||
|
||||
@@ -440,7 +440,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
DocFlagsToggle(doc,DOCF_PLAIN_TEXT);
|
||||
DocWrite(doc);
|
||||
task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
|
||||
st2=CurDir;
|
||||
st2=DirCur;
|
||||
st=MStrPrint("Cd(\"%s\");",st2);
|
||||
tmpc=TaskExe(task,Fs,st,1<<JOBf_WAKE_MASTER|1<<JOBf_FOCUS_MASTER);
|
||||
Free(st2);
|
||||
@@ -504,7 +504,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
case EF_REINDENT:
|
||||
start_y=doc->cur_entry->y;
|
||||
EdReplaceTroubleAll(doc,TRUE,FALSE);
|
||||
DocLineNumGoTo(doc,start_y+1);
|
||||
DocGoToLine(doc,start_y+1);
|
||||
if (EdGoToFun(doc,FALSE,FALSE)) {
|
||||
start_y=doc->cur_entry->y;
|
||||
indent=EdRICode(doc);
|
||||
@@ -516,7 +516,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
}
|
||||
DocLock(doc);
|
||||
EdRemFunLeadingSpace(doc);
|
||||
DocLineNumGoTo(doc,start_y+1);
|
||||
DocGoToLine(doc,start_y+1);
|
||||
doc_e=doc->cur_entry;
|
||||
end_y=start_y+indent->total_cnt;
|
||||
while (start_y<=doc_e->y<end_y) {
|
||||
@@ -562,7 +562,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
}
|
||||
start_y=doc->cur_entry->y;
|
||||
EdReplaceTroubleAll(doc,FALSE,FALSE);
|
||||
DocLineNumGoTo(doc,start_y+1);
|
||||
DocGoToLine(doc,start_y+1);
|
||||
break;
|
||||
case EF_RENUM_ASM:
|
||||
if (EdGoToFun(doc,FALSE,TRUE)) {
|
||||
@@ -588,7 +588,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
}
|
||||
|
||||
DocRecalc(doc);
|
||||
DocLineNumGoTo(doc,goto_line_num);
|
||||
DocGoToLine(doc,goto_line_num);
|
||||
|
||||
DocUnlock(doc);
|
||||
if (!unlock)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#help_index "DolDoc/Editor"
|
||||
|
||||
public Bool DocLineNumGoTo(CDoc *doc,I64 line_num) //one based
|
||||
public Bool DocGoToLine(CDoc *doc,I64 line_num) //one based
|
||||
{//Nearest to specified line num. Move cur_entry & center.
|
||||
Bool res=FALSE,unlock;
|
||||
if (doc) {
|
||||
@@ -30,7 +30,7 @@ U8 *needle,I64 match=1)
|
||||
res=TRUE;
|
||||
doc_e=haystack_doc->head.next;
|
||||
} else {
|
||||
res=DocLineNumGoTo(haystack_doc,start_line_num);
|
||||
res=DocGoToLine(haystack_doc,start_line_num);
|
||||
doc_e=haystack_doc->cur_entry;
|
||||
}
|
||||
if (res) {
|
||||
@@ -580,5 +580,5 @@ U0 EdGoToLine(CDoc *doc)
|
||||
CEdLineGoTo gtl;
|
||||
gtl.line=1;
|
||||
if (DocForm(>l))
|
||||
DocLineNumGoTo(doc,gtl.line);
|
||||
DocGoToLine(doc,gtl.line);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
if (res || other_found)
|
||||
switch (type) {
|
||||
case LK_FILE_LINE:
|
||||
res=DocLineNumGoTo(doc,*_num);
|
||||
res=DocGoToLine(doc,*_num);
|
||||
break;
|
||||
case LK_FILE_ANCHOR:
|
||||
res=DocAnchorFind(doc,needle_str);
|
||||
|
||||
+10
-16
@@ -8,22 +8,16 @@ public CTask *PopUpViewDoc(CDoc *doc,I64 dof_flags=0)
|
||||
return task;
|
||||
}
|
||||
|
||||
U0 PopUpViewPrintEndCB()
|
||||
{
|
||||
DocDel(FramePtr("ViewStrFrame"));
|
||||
Exit;
|
||||
}
|
||||
|
||||
public CTask *PopUpViewPrint(U8 *fmt,...)
|
||||
{//View Print stmt in PopUp win task.
|
||||
CTask *task;
|
||||
CTask *task=Spawn(&SrvCmdLine,NULL,"View",,Fs);
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
CDoc *doc=DocNew;
|
||||
CDoc *doc=DocNew(,task);
|
||||
DocPrint(doc,buf);
|
||||
Free(buf);
|
||||
task=PopUpViewDoc(doc);
|
||||
FramePtrAdd("ViewStrFrame",doc,task);
|
||||
task->task_end_cb=&PopUpViewPrintEndCB;
|
||||
buf=MStrPrint("DocEd(0x%X);",doc);
|
||||
TaskExe(task,NULL,buf,1<<JOBf_EXIT_ON_COMPLETE|1<<JOBf_FREE_ON_COMPLETE);
|
||||
Free(buf);
|
||||
return task;
|
||||
}
|
||||
|
||||
@@ -34,7 +28,7 @@ public U8 *PopUpPickFile(U8 *dir=NULL)
|
||||
if (dir)
|
||||
st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",dir);
|
||||
else {
|
||||
st2=CurDir;
|
||||
st2=DirCur;
|
||||
st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_FILE,Fs->parent_task);",st2);
|
||||
Free(st2);
|
||||
}
|
||||
@@ -49,7 +43,7 @@ public U8 *PopUpPickDir(U8 *dir=NULL)
|
||||
if (dir)
|
||||
st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",dir);
|
||||
else {
|
||||
st2=CurDir;
|
||||
st2=DirCur;
|
||||
st=MStrPrint("Cd(\"%Q\");FileMgr(FM_PICK_DIR,Fs->parent_task);",st2);
|
||||
Free(st2);
|
||||
}
|
||||
@@ -270,7 +264,7 @@ public I64 AdamFile(U8 *filename,Bool warn_ext=TRUE)
|
||||
{//Make adam_task execute file.
|
||||
Bool okay=TRUE;
|
||||
U8 *name=FileNameAbs(filename),
|
||||
*name2=DftExt(name,"HC.Z");
|
||||
*name2=ExtDft(name,"HC.Z");
|
||||
I64 res=0;
|
||||
if (warn_ext &&
|
||||
!FilesFindMatch(name2,FILEMASK_JIT) &&
|
||||
@@ -288,7 +282,7 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
|
||||
{//$LK,"ExeFile2",A="MN:ExeFile2"$() in $LK,"PopUp",A="MN:PopUp"$ task. Cont as User.
|
||||
Bool okay=TRUE;
|
||||
U8 *st,*name=FileNameAbs(filename),
|
||||
*name2=DftExt(name,"HC.Z");
|
||||
*name2=ExtDft(name,"HC.Z");
|
||||
I64 res=0;
|
||||
if (warn_ext &&
|
||||
!FilesFindMatch(name2,FILEMASK_JIT) &&
|
||||
@@ -310,7 +304,7 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
|
||||
public I64 PopUpRunFile(U8 *filename,I64 ccf_flags=0,...)
|
||||
{//$LK,"ExeFile",A="MN:ExeFile"$() with args using $LK,"LastFun",A="MN:LastFun"$() in $LK,"PopUp",A="MN:PopUp"$ task.
|
||||
U8 *st,*name=FileNameAbs(filename),
|
||||
*name2=DftExt(name,"HC.Z");
|
||||
*name2=ExtDft(name,"HC.Z");
|
||||
I64 res=0;
|
||||
st=MStrPrint(
|
||||
"\"$$$$WW+H,1$$$$\";ExeFile2(\"%s\",0x%X);LastFun(0x%X,0x%X);",
|
||||
|
||||
+12
-12
@@ -182,12 +182,12 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Cut To Clipboard");
|
||||
KeyDescSet("Edit/Cut To Clip");
|
||||
else
|
||||
KeyDescSet("Char /Delete");
|
||||
} else {
|
||||
if (sc&SCF_SHIFT)
|
||||
EdCutToClipboard(doc);
|
||||
ClipCut(doc);
|
||||
else
|
||||
EdCharDel(doc);
|
||||
}
|
||||
@@ -197,16 +197,16 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (sc&(SCF_SHIFT|SCF_CTRL)!=(SCF_SHIFT|SCF_CTRL)) {
|
||||
if (sc&SCF_KEY_DESC) {
|
||||
if (sc&SCF_SHIFT)
|
||||
KeyDescSet("Edit/Paste Clipboard");
|
||||
KeyDescSet("Edit/Paste Clip");
|
||||
else if (sc&SCF_CTRL)
|
||||
KeyDescSet("Edit/Copy to Clipboard");
|
||||
KeyDescSet("Edit/Copy to Clip");
|
||||
else
|
||||
KeyDescSet("Edit/Toggle Overstrike");
|
||||
} else {
|
||||
if (sc&SCF_SHIFT)
|
||||
EdPasteClipboard(doc);
|
||||
ClipPaste(doc);
|
||||
else if (sc&SCF_CTRL)
|
||||
EdCopyToClipboard(doc);
|
||||
ClipCopy(doc);
|
||||
else
|
||||
doc->flags^=DOCF_OVERSTRIKE;
|
||||
}
|
||||
@@ -383,9 +383,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
case CH_CTRLC:
|
||||
if (!(sc&SCF_SHIFT)) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Copy to Clipboard");
|
||||
KeyDescSet("Edit/Copy to Clip");
|
||||
else
|
||||
EdCopyToClipboard(doc);
|
||||
ClipCopy(doc);
|
||||
}
|
||||
break;
|
||||
case CH_CTRLD:
|
||||
@@ -616,9 +616,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
case CH_CTRLV:
|
||||
if (!(sc&SCF_SHIFT)) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Paste Clipboard");
|
||||
KeyDescSet("Edit/Paste Clip");
|
||||
else
|
||||
EdPasteClipboard(doc);
|
||||
ClipPaste(doc);
|
||||
}
|
||||
break;
|
||||
case CH_CTRLW:
|
||||
@@ -637,9 +637,9 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
case CH_CTRLX:
|
||||
if (!(sc&SCF_SHIFT)) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Cut To Clipboard");
|
||||
KeyDescSet("Edit/Cut To Clip");
|
||||
else
|
||||
EdCutToClipboard(doc);
|
||||
ClipCut(doc);
|
||||
}
|
||||
break;
|
||||
case CH_CTRLY:
|
||||
|
||||
+85
-9
@@ -1,9 +1,9 @@
|
||||
#help_index "DolDoc"
|
||||
#help_index "DolDoc/Tree"
|
||||
|
||||
public Bool DocTreeFind(CDoc *haystack_doc,U8 *needle_path,
|
||||
CDocEntry **_tree_entry=NULL,
|
||||
CDocEntry **_start_indent=NULL, CDocEntry **_end_indent=NULL)
|
||||
{//Find registry-like tree widget start and end.
|
||||
{//Find tree widget start and end.
|
||||
I64 i=0,k=0;
|
||||
U8 *st1=StrNew(needle_path),*st2=MAlloc(StrLen(needle_path)+1);
|
||||
Bool res=FALSE,unlock_doc=DocLock(haystack_doc);
|
||||
@@ -58,8 +58,16 @@ ft_done:
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeFFind(U8 *name,U8 *path)
|
||||
{//Find tree widget in file.
|
||||
CDoc *doc=DocRead(name);
|
||||
Bool res=DocTreeFind(doc,path);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeMake(CDoc *doc,U8 *path)
|
||||
{//Make registry-like tree widget.
|
||||
{//Make tree widget.
|
||||
I64 i=0,j=I64_MIN,k=0;
|
||||
U8 *st1=StrNew(path),
|
||||
*st2=MAlloc(StrLen(path)+1),
|
||||
@@ -113,6 +121,73 @@ mt_done:
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool DocTreeWriteJoin(CDoc *doc,U8 *path,Bool write,U8 *fmt,I64 argc,I64 *argv)
|
||||
{//Rewrite doc tree branch.
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
Bool res,unlock_doc=DocLock(doc);
|
||||
if (res=DocTreeFind(doc,path,
|
||||
&tree_branch,&start_indent,&end_indent)) {
|
||||
DocCut(doc,start_indent->next,end_indent->last);
|
||||
doc->cur_entry=start_indent->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
} else
|
||||
DocTreeMake(doc,path);
|
||||
DocPrint(doc,"%s",buf);
|
||||
if (write && DrvIsWritable(*doc->filename.name))
|
||||
DocWrite(doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
Free(buf);
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool DocTreeAppendJoin(CDoc *doc,U8 *path,Bool write,U8 *fmt,I64 argc,I64 *argv)
|
||||
{//Append to doc tree branch.
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
Bool res,unlock_doc=DocLock(doc);
|
||||
if (res=DocTreeFind(doc,path,
|
||||
&tree_branch,&start_indent,&end_indent)) {
|
||||
doc->cur_entry=end_indent;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
} else
|
||||
DocTreeMake(doc,path);
|
||||
DocPrint(doc,"%s",buf);
|
||||
if (write && DrvIsWritable(*doc->filename.name))
|
||||
DocWrite(doc);
|
||||
if (unlock_doc)
|
||||
DocUnlock(doc);
|
||||
Free(buf);
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeWrite(CDoc *doc,U8 *path,Bool write=TRUE,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch.
|
||||
return DocTreeWriteJoin(doc,path,write,fmt,argc,argv);
|
||||
}
|
||||
|
||||
public Bool DocTreeAppend(CDoc *doc,U8 *path,Bool write=TRUE,U8 *fmt,...)
|
||||
{//Append to doc tree branch.
|
||||
return DocTreeAppendJoin(doc,path,write,fmt,argc,argv);
|
||||
}
|
||||
|
||||
public Bool DocTreeFWrite(U8 *name,U8 *path,U8 *fmt,...)
|
||||
{//Rewrite doc tree branch in file.
|
||||
CDoc *doc=DocRead(name);
|
||||
Bool res=DocTreeWriteJoin(doc,path,TRUE,fmt,argc,argv);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocTreeFAppend(U8 *name,U8 *path,U8 *fmt,...)
|
||||
{//Append to doc tree branch in file.
|
||||
CDoc *doc=DocRead(name);
|
||||
Bool res=DocTreeAppendJoin(doc,path,TRUE,fmt,argc,argv);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "DolDoc/Compiler;Compiler"
|
||||
public I64 ExeDoc(CDoc *doc,I64 ccf_flags=0)
|
||||
{//JIT Compile and execute a document.
|
||||
@@ -141,8 +216,9 @@ public I64 ExeDoc(CDoc *doc,I64 ccf_flags=0)
|
||||
return res;
|
||||
}
|
||||
|
||||
public I64 DocTreeBranchExe(CDoc *doc,U8 *path)
|
||||
{//JIT Compile and execute code in doc tree branch.
|
||||
#help_index "DolDoc/Tree;DolDoc/Compiler;Compiler"
|
||||
public I64 DocTreeExe(CDoc *doc,U8 *path)
|
||||
{//Execute doc tree branch.
|
||||
CDoc *doc2;
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *tree_branch,*start_indent,*end_indent;
|
||||
@@ -157,11 +233,11 @@ public I64 DocTreeBranchExe(CDoc *doc,U8 *path)
|
||||
return res;
|
||||
}
|
||||
|
||||
public I64 ExeTreeBranch(U8 *registry_file,U8 *path)
|
||||
{//JIT Compile and execute a specified branch in a specified file.
|
||||
public I64 DocTreeFExe(U8 *name,U8 *path)
|
||||
{//Execute doc tree branch in file.
|
||||
I64 res;
|
||||
CDoc *doc=DocRead(registry_file);
|
||||
res=DocTreeBranchExe(doc,path);
|
||||
CDoc *doc=DocRead(name);
|
||||
res=DocTreeExe(doc,path);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public U8 *BibleLine2Verse(I64 line,I64 separate_ch=CH_SPACE)
|
||||
}
|
||||
if (0<=--i<cnt) {
|
||||
doc=DocRead(BIBLE_FILENAME,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocLineNumGoTo(doc,line); //one based
|
||||
DocGoToLine(doc,line); //one based
|
||||
doc_e=doc->cur_entry;
|
||||
while (doc_e!=doc && (doc_e->type_u8!=DOCT_TEXT || !*doc_e->tag))
|
||||
doc_e=doc_e->next;
|
||||
@@ -222,7 +222,7 @@ public U0 BookLines(CDoc *doc_out=NULL,I64 start,I64 lines,
|
||||
if (!doc_out) doc_out=DocPut;
|
||||
if (doc_out && FileFind(book_filename)) {
|
||||
doc_in=DocRead(book_filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocLineNumGoTo(doc_in,start); //one based
|
||||
DocGoToLine(doc_in,start); //one based
|
||||
doc_e=doc_in->cur_entry;
|
||||
while (lines>0 && doc_e!=doc_in) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
@@ -255,7 +255,7 @@ public U0 BibleVerse(CDoc *doc_out=NULL,U8 *verse,I64 lines)
|
||||
if (i>=0) {
|
||||
i=Str2I64(DefineSub(i,"ST_BIBLE_BOOK_LINES"));
|
||||
doc_in=DocRead(BIBLE_FILENAME,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocLineNumGoTo(doc_in,i); //one based
|
||||
DocGoToLine(doc_in,i); //one based
|
||||
if (*st2) {
|
||||
StrCpy(doc_in->find_replace->find_text,st2);
|
||||
EdFindNext(doc_in);
|
||||
|
||||
@@ -135,6 +135,14 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
|
||||
return god.num_words;
|
||||
} GodInit;
|
||||
|
||||
public U8 *GodWordStr(I64 bits=17)
|
||||
{//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$
|
||||
if (god.num_words)
|
||||
return god.words[GodBits(bits)%god.num_words];
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public U0 GodWord(I64 bits=17,Bool show_num=FALSE)
|
||||
{//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$
|
||||
I64 i;
|
||||
|
||||
+2
-2
@@ -379,7 +379,7 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
|
||||
public I64 GRWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
{//TempleOS GR File.
|
||||
I64 size;
|
||||
U8 *st=DftExt(filename,"GR.Z"),
|
||||
U8 *st=ExtDft(filename,"GR.Z"),
|
||||
*src=DCSave(dc,&size,dcsf_flags);
|
||||
FileWrite(st,src,size);
|
||||
Free(st);
|
||||
@@ -390,7 +390,7 @@ public I64 GRWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
public CDC *GRRead(U8 *filename,CTask *task=NULL)
|
||||
{//TempleOS GR File.
|
||||
CDC *dc=NULL;
|
||||
U8 *st=DftExt(filename,"GR.Z"),
|
||||
U8 *st=ExtDft(filename,"GR.Z"),
|
||||
*src=FileRead(st);
|
||||
if (src)
|
||||
dc=DCLoad(src,,task);
|
||||
|
||||
+7
-7
@@ -10,20 +10,20 @@ U0 CtrlAltZ(I64 sc)
|
||||
CtrlAltCBSet('Z',&CtrlAltZ,"Cmd /Zoom In",
|
||||
"Cmd /Zoom Out");
|
||||
|
||||
U0 Scrn2Clipboard(I64)
|
||||
U0 Scrn2Clip(I64)
|
||||
{
|
||||
CDC *dc=DCScrnCapture;
|
||||
U8 *elems=DC2Sprite(dc);
|
||||
Bool unlock_doc=DocLock(sys_clipboard_doc);
|
||||
ClipboardDel;
|
||||
DocSprite(sys_clipboard_doc,elems);
|
||||
Bool unlock_doc=DocLock(sys_clip_doc);
|
||||
ClipDel;
|
||||
DocSprite(sys_clip_doc,elems);
|
||||
if (unlock_doc)
|
||||
DocUnlock(sys_clipboard_doc);
|
||||
DocUnlock(sys_clip_doc);
|
||||
Free(elems);
|
||||
DCDel(dc);
|
||||
}
|
||||
U0 CtrlAltS(I64)
|
||||
{
|
||||
Spawn(&Scrn2Clipboard);
|
||||
Spawn(&Scrn2Clip);
|
||||
}
|
||||
CtrlAltCBSet('S',&CtrlAltS,"Cmd /Scrn Shot to Clipboard");
|
||||
CtrlAltCBSet('S',&CtrlAltS,"Cmd /Scrn Shot to Clip");
|
||||
+24
-24
@@ -75,10 +75,10 @@ I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
|
||||
"$$MU-UL,\"Flood Fill Not Color\",LE=SPBM_FLOOD_FILL_NOT$$\n"
|
||||
"$$MU-UL,\"PolyLine\",LE=SPBM_POLYLINE$$\n"
|
||||
"$$MU-UL,\"PolyPoint\",LE=SPBM_POLYPT$$\n"
|
||||
"\n$$MU-UL,\"Copy to Clipboard\",LE=SPBM_COPY$$\n"
|
||||
"$$MU-UL,\"Delete to Clipboard\",LE=SPBM_DELETE$$\n"
|
||||
"$$MU-UL,\"Paste Clipboard\",LE=SPBM_PASTE$$\n"
|
||||
"$$MU-UL,\"Paste Transparent Clipboard\",LE=SPBM_PASTE_TRANSPARENT$$\n"
|
||||
"\n$$MU-UL,\"Copy to Clip\",LE=SPBM_COPY$$\n"
|
||||
"$$MU-UL,\"Delete to Clip\",LE=SPBM_DELETE$$\n"
|
||||
"$$MU-UL,\"Paste Clip\",LE=SPBM_PASTE$$\n"
|
||||
"$$MU-UL,\"Paste Transparent Clip\",LE=SPBM_PASTE_TRANSPARENT$$\n"
|
||||
"\n$$MU-UL,\"Save BMP File\",LE=SPBM_SAVE_BMP$$\n"
|
||||
"$$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GRA$$\n"
|
||||
"\n$$MU-UL,\"Undo\",LE=SPBM_UNDO$$\n"
|
||||
@@ -208,7 +208,7 @@ I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
|
||||
U8 *st=NULL;
|
||||
CEdFileName filename;
|
||||
CDC *img=*_img,
|
||||
*clipboard=NULL,*undo=NULL,*dc2;
|
||||
*clip=NULL,*undo=NULL,*dc2;
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
|
||||
doc_e->de_flags|=DOCEF_DONT_DRAW;
|
||||
@@ -390,14 +390,14 @@ bm_menu:
|
||||
break;
|
||||
case SPBM_PASTE:
|
||||
case SPBM_PASTE_TRANSPARENT:
|
||||
if (clipboard) {
|
||||
if (clip) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (mode==SPBM_PASTE) {
|
||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(dc,arg1,arg2,clipboard);
|
||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||
clip->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(dc,arg1,arg2,clip);
|
||||
clip->flags&=~DCF_NO_TRANSPARENTS;
|
||||
} else {
|
||||
dc2=DCCopy(clipboard);
|
||||
dc2=DCCopy(clip);
|
||||
DCColorChg(dc2,bkcolor);
|
||||
GrBlot(dc,arg1,arg2,dc2);
|
||||
DCDel(dc2);
|
||||
@@ -517,14 +517,14 @@ bm_menu:
|
||||
break;
|
||||
case SPBM_PASTE:
|
||||
case SPBM_PASTE_TRANSPARENT:
|
||||
if (clipboard) {
|
||||
if (clip) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (mode==SPBM_PASTE) {
|
||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(dc,arg1,arg2,clipboard);
|
||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||
clip->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(dc,arg1,arg2,clip);
|
||||
clip->flags&=~DCF_NO_TRANSPARENTS;
|
||||
} else {
|
||||
dc2=DCCopy(clipboard);
|
||||
dc2=DCCopy(clip);
|
||||
DCColorChg(dc2,bkcolor);
|
||||
GrBlot(dc,arg1,arg2,dc2);
|
||||
DCDel(dc2);
|
||||
@@ -611,9 +611,9 @@ bm_menu:
|
||||
y11=arg2;
|
||||
y22=y1;
|
||||
}
|
||||
DCDel(clipboard);
|
||||
clipboard=DCExt(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
|
||||
clipboard->bkcolor=bkcolor;
|
||||
DCDel(clip);
|
||||
clip=DCExt(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
|
||||
clip->bkcolor=bkcolor;
|
||||
if (mode==SPBM_DELETE) {
|
||||
img->color=bkcolor;
|
||||
GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
|
||||
@@ -629,14 +629,14 @@ bm_menu:
|
||||
break;
|
||||
case SPBM_PASTE:
|
||||
case SPBM_PASTE_TRANSPARENT:
|
||||
if (clipboard) {
|
||||
if (clip) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (mode==SPBM_PASTE) {
|
||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(img,arg1-xx1,arg2-yy1,clipboard);
|
||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||
clip->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(img,arg1-xx1,arg2-yy1,clip);
|
||||
clip->flags&=~DCF_NO_TRANSPARENTS;
|
||||
} else {
|
||||
dc2=DCCopy(clipboard);
|
||||
dc2=DCCopy(clip);
|
||||
DCColorChg(dc2,bkcolor);
|
||||
GrBlot(img,arg1-xx1,arg2-yy1,dc2);
|
||||
DCDel(dc2);
|
||||
@@ -665,7 +665,7 @@ bm_menu:
|
||||
bm_key_up_done:
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
bm_done:
|
||||
DCDel(clipboard);
|
||||
DCDel(clip);
|
||||
DCDel(undo);
|
||||
Free(st);
|
||||
DCFill(dc);
|
||||
|
||||
+9
-9
@@ -724,7 +724,7 @@ Bool SpriteEdText(CSprite **_head,I64 *_cur_elem_num)
|
||||
#define SPED_SET_ORIGIN 10
|
||||
#define SPED_SHIFT_SUB_ORIGIN 11
|
||||
#define SPED_TEXT_ED 12
|
||||
#define SPED_INS_CLIPBOARD 13
|
||||
#define SPED_INS_CLIP 13
|
||||
#define SPED_MAIN_MENU 14
|
||||
#define SPED_EXIT 15
|
||||
|
||||
@@ -733,7 +733,7 @@ U0 GrInit3()
|
||||
DefineLstLoad("ST_SPRITE_ED_MENU","Select/Unselect All\0 \0Select\0"
|
||||
"Select Rects\0Unselect\0Unselect Rects\0Shift Points\0Shift Rects\0"
|
||||
"Shift Selected\0Transform Selected\0Set Origin\0"
|
||||
"Insert Shift SubOrigin\0Edit as Text\0Insert Clipboard\0Main Menu\0");
|
||||
"Insert Shift SubOrigin\0Edit as Text\0Insert Clip\0Main Menu\0");
|
||||
}
|
||||
GrInit3;
|
||||
|
||||
@@ -757,7 +757,7 @@ I64 PopUpSpriteEd(CSprite **_head,I64 *_cur_elem_num)
|
||||
"$$MU-UL,\"Set Origin\",LE=SPED_SET_ORIGIN$$\n"
|
||||
"$$MU-UL,\"Insert Shift SubOrigin\",LE=SPED_SHIFT_SUB_ORIGIN$$\n\n"
|
||||
"$$MU-UL,\"Edit as Text\",LE=SPED_TEXT_ED$$\n"
|
||||
"$$MU-UL,\"Insert Clipboard Sprite's\",LE=SPED_INS_CLIPBOARD$$\n\n"
|
||||
"$$MU-UL,\"Insert Clip Sprite's\",LE=SPED_INS_CLIP$$\n\n"
|
||||
"$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=SPED_MAIN_MENU$$$$LTBLUE$$\n"
|
||||
"$$MU-UL,\"Exit Sprite\",LE=SPED_EXIT$$\n"
|
||||
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$");
|
||||
@@ -1218,17 +1218,17 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
} while (msg_code!=MSG_MS_L_UP);
|
||||
*_cur_elem_num+=1;
|
||||
break;
|
||||
case SPED_INS_CLIPBOARD:
|
||||
RegOneTimePopUp(ARf_CSPRITE_INS_CLIPBOARD,
|
||||
case SPED_INS_CLIP:
|
||||
RegOneTimePopUp(ARf_CSPRITE_INS_CLIP,
|
||||
"You will probably want to shift around\n"
|
||||
"the location of element groups. Use\n"
|
||||
"'Insert shift sub-origin' after picking the\n"
|
||||
"element to insert before. Or,\n"
|
||||
"use 'shift points'.\n");
|
||||
insert_pt=SpriteSetSettings(,*_head,*_cur_elem_num);
|
||||
unlock=DocLock(sys_clipboard_doc);
|
||||
doc_e2=sys_clipboard_doc->head.next;
|
||||
while (doc_e2!=sys_clipboard_doc) {
|
||||
unlock=DocLock(sys_clip_doc);
|
||||
doc_e2=sys_clip_doc->head.next;
|
||||
while (doc_e2!=sys_clip_doc) {
|
||||
if (doc_e2->type_u8==DOCT_SPRITE) {
|
||||
head2=Sprite2SpriteQue(doc_e2->bin_data->data);
|
||||
if (head2->next!=head2) {
|
||||
@@ -1249,7 +1249,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
doc_e2=doc_e2->next;
|
||||
}
|
||||
if (unlock)
|
||||
DocUnlock(sys_clipboard_doc);
|
||||
DocUnlock(sys_clip_doc);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
break;
|
||||
case SPED_TEXT_ED:
|
||||
|
||||
+33
-33
@@ -588,33 +588,33 @@ U0 MeshCursorW(CMeshFrame *e,CTask *task,I64 *_x,I64 *_y,I64 *_z)
|
||||
*_x=x; *_y=y; *_z=z;
|
||||
}
|
||||
|
||||
CMeshEdVertex sys_clipboard_vertex_head;
|
||||
CMeshEdTri sys_clipboard_tri_head;
|
||||
CMeshEdVertex sys_clip_vertex_head;
|
||||
CMeshEdTri sys_clip_tri_head;
|
||||
|
||||
U0 MeshClipboardInit()
|
||||
U0 MeshClipInit()
|
||||
{
|
||||
QueInit(&sys_clipboard_vertex_head);
|
||||
QueInit(&sys_clipboard_tri_head);
|
||||
QueInit(&sys_clip_vertex_head);
|
||||
QueInit(&sys_clip_tri_head);
|
||||
}
|
||||
|
||||
U0 MeshClipboardRst()
|
||||
U0 MeshClipRst()
|
||||
{
|
||||
QueDel(&sys_clipboard_vertex_head,TRUE);
|
||||
QueDel(&sys_clipboard_tri_head,TRUE);
|
||||
MeshClipboardInit;
|
||||
QueDel(&sys_clip_vertex_head,TRUE);
|
||||
QueDel(&sys_clip_tri_head,TRUE);
|
||||
MeshClipInit;
|
||||
}
|
||||
|
||||
U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
U0 MeshClipCopy(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv2;
|
||||
CMeshEdTri *tmpt=e->tri_head.next,*tmpt2;
|
||||
|
||||
MeshClipboardRst;
|
||||
MeshClipRst;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (tmpv->flags&VF_SEL) {
|
||||
tmpv->copy=tmpv2=ACAlloc(sizeof(CMeshEdVertex));
|
||||
MemCpy(&tmpv2->p,&tmpv->p,sizeof(CD3I32));
|
||||
QueIns(tmpv2,sys_clipboard_vertex_head.last);
|
||||
QueIns(tmpv2,sys_clip_vertex_head.last);
|
||||
tmpv->flags|=VF_COPIED;
|
||||
tmpv->flags&=~VF_SEL;
|
||||
} else {
|
||||
@@ -631,7 +631,7 @@ U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
tmpt2->t[1]=tmpt->t[1]->copy;
|
||||
tmpt2->t[2]=tmpt->t[2]->copy;
|
||||
tmpt2->mt.color=tmpt->mt.color;
|
||||
QueIns(tmpt2,sys_clipboard_tri_head.last);
|
||||
QueIns(tmpt2,sys_clip_tri_head.last);
|
||||
tmpt->flags|=TF_COPIED;
|
||||
tmpt->flags&=~TF_SEL;
|
||||
} else
|
||||
@@ -640,11 +640,11 @@ U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshClipboardCut(CMeshFrame *e)
|
||||
U0 MeshClipCut(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
|
||||
CMeshEdTri *tmpt=e->tri_head.next,*tmpt1;
|
||||
MeshClipboardCopy(e);
|
||||
MeshClipCopy(e);
|
||||
while (tmpt!=&e->tri_head) {
|
||||
tmpt1=tmpt->next;
|
||||
if (tmpt->flags&TF_COPIED)
|
||||
@@ -659,8 +659,8 @@ U0 MeshClipboardCut(CMeshFrame *e)
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshClipboardDel(CMeshFrame *e)
|
||||
{//Technically not clipboard
|
||||
U0 MeshClipDel(CMeshFrame *e)
|
||||
{//Technically not clip
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
|
||||
CMeshEdTri *tmpt=e->tri_head.next,*tmpt1;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
@@ -677,14 +677,14 @@ U0 MeshClipboardDel(CMeshFrame *e)
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshClipboardPaste(CMeshFrame *e)
|
||||
U0 MeshClipPaste(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tmpv2=sys_clipboard_vertex_head.next,*tmpv;
|
||||
CMeshEdTri *tmpt2=sys_clipboard_tri_head.next,*tmpt;
|
||||
CMeshEdVertex *tmpv2=sys_clip_vertex_head.next,*tmpv;
|
||||
CMeshEdTri *tmpt2=sys_clip_tri_head.next,*tmpt;
|
||||
|
||||
MeshVertexSelAll(e,FALSE);
|
||||
MeshTriSelAll(e,FALSE);
|
||||
while (tmpv2!=&sys_clipboard_vertex_head) {
|
||||
while (tmpv2!=&sys_clip_vertex_head) {
|
||||
tmpv2->copy=tmpv=CAlloc(sizeof(CMeshEdVertex));
|
||||
MemCpy(&tmpv->p,&tmpv2->p,sizeof(CD3I32));
|
||||
QueIns(tmpv,e->vertex_head.last);
|
||||
@@ -692,7 +692,7 @@ U0 MeshClipboardPaste(CMeshFrame *e)
|
||||
tmpv2=tmpv2->next;
|
||||
}
|
||||
|
||||
while (tmpt2!=&sys_clipboard_tri_head) {
|
||||
while (tmpt2!=&sys_clip_tri_head) {
|
||||
tmpt=MeshTriNew(e,tmpt2->mt.color,tmpt2->t[0]->copy,
|
||||
tmpt2->t[1]->copy,tmpt2->t[2]->copy);
|
||||
tmpt->flags|=TF_SEL;
|
||||
@@ -700,7 +700,7 @@ U0 MeshClipboardPaste(CMeshFrame *e)
|
||||
}
|
||||
}
|
||||
|
||||
MeshClipboardInit;
|
||||
MeshClipInit;
|
||||
|
||||
U0 DrawIt(CTask *task,CDC *dc)
|
||||
{
|
||||
@@ -1088,10 +1088,10 @@ me_restart:
|
||||
switch (arg2.u8[0]) {
|
||||
case SC_DELETE:
|
||||
if (arg2&SCF_SHIFT)
|
||||
goto me_clipboard_cut;
|
||||
goto me_clip_cut;
|
||||
else {
|
||||
if (MeshSelCnt(&e))
|
||||
MeshClipboardDel(&e);
|
||||
MeshClipDel(&e);
|
||||
else if (e.ed_mode!='t')
|
||||
MeshVertexDel(&e,MeshVertexFindScrPt(&e,
|
||||
ms.presnap.x-Fs->pix_left-Fs->scroll_x,
|
||||
@@ -1103,9 +1103,9 @@ me_restart:
|
||||
break;
|
||||
case SC_INS:
|
||||
if (arg2&SCF_CTRL)
|
||||
goto me_clipboard_copy;
|
||||
goto me_clip_copy;
|
||||
else if (arg2&SCF_SHIFT)
|
||||
goto me_clipboard_paste;
|
||||
goto me_clip_paste;
|
||||
}
|
||||
break;
|
||||
case CH_BACKSPACE:
|
||||
@@ -1209,27 +1209,27 @@ me_chain:
|
||||
WinBorder(Bt(&Fs->display_flags,DISPLAYf_NO_BORDER));
|
||||
break;
|
||||
case CH_CTRLC:
|
||||
me_clipboard_copy:
|
||||
me_clip_copy:
|
||||
if (e.ed_mode=='t') {
|
||||
Beep;Beep;
|
||||
} else
|
||||
MeshClipboardCopy(&e);
|
||||
MeshClipCopy(&e);
|
||||
break;
|
||||
case CH_CTRLV:
|
||||
me_clipboard_paste:
|
||||
me_clip_paste:
|
||||
if (e.ed_mode=='t') {
|
||||
Beep;Beep;
|
||||
} else {
|
||||
MeshClipboardPaste(&e);
|
||||
MeshClipPaste(&e);
|
||||
e.ed_mode='m';
|
||||
}
|
||||
break;
|
||||
case CH_CTRLX:
|
||||
me_clipboard_cut:
|
||||
me_clip_cut:
|
||||
if (e.ed_mode=='t') {
|
||||
Beep;Beep;
|
||||
} else
|
||||
MeshClipboardCut(&e);
|
||||
MeshClipCut(&e);
|
||||
break;
|
||||
case CH_SHIFT_ESC:
|
||||
save_and_exit=FALSE;
|
||||
|
||||
+2
-2
@@ -59,8 +59,8 @@ Place the CDDVD %s in the drive.
|
||||
",iso_filename;
|
||||
}
|
||||
if (PressAKey!=CH_SHIFT_ESC) {
|
||||
">$FG,2$ChgDsk('T');$FG$\n\n";
|
||||
ChgDsk('T');
|
||||
">$FG,2$DskChg('T');$FG$\n\n";
|
||||
DskChg('T');
|
||||
res=TRUE;
|
||||
}
|
||||
} catch
|
||||
|
||||
@@ -35,19 +35,19 @@ public U0 BootHDIns(U8 drv_let=0)
|
||||
else {
|
||||
Free(de.full_name);
|
||||
"Modifying partition boot record.\n";
|
||||
RBlks(dv,&br,dv->drv_offset,1);
|
||||
BlkRead(dv,&br,dv->drv_offset,1);
|
||||
br.jump_and_nop[0]=OC_JMP_REL8;
|
||||
br.jump_and_nop[1]=offset(CFAT32Boot.code)-2;
|
||||
#assert offset(CFAT32Boot.code)>=offset(CRedSeaBoot.code)
|
||||
br.jump_and_nop[2]=OC_NOP;
|
||||
*BHD_BLK_CNT(U16 *)=(de.size+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||
*BHD_DAP_BLK(I64 *)=Cluster2Blk(dv,de.cluster);
|
||||
*BHD_DAP_BLK(I64 *)=Clus2Blk(dv,de.clus);
|
||||
for (i=0;i<BHD_END-BHD_CODE;i++)
|
||||
br.code[i]=BHD_CODE(U8 *)[i];
|
||||
#assert sizeof(CFAT32Boot.code)>=BHD_END-BHD_CODE
|
||||
for (;i<sizeof(CFAT32Boot.code);i++)
|
||||
br.code[i]=0;
|
||||
WBlks(dv,&br,dv->drv_offset,1);
|
||||
BlkWrite(dv,&br,dv->drv_offset,1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -29,7 +29,7 @@ public U0 BootMHDOldRead(U8 src_drv,U8 dst_drv)
|
||||
BlkDevUnlock(bd);
|
||||
|
||||
Drv(dst_drv);
|
||||
MkDir(BOOT_DIR);
|
||||
DirMk(BOOT_DIR);
|
||||
FileWrite(BOOT_DIR_OLDMBR_BIN_C,&mbr,BLK_SIZE);
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public Bool BootMHDIns(U8 drv_let,U8 *drv_lst=NULL)
|
||||
j=0;
|
||||
if (FileFind(BOOT_DIR_OLDMBR_BIN_C,&de,FUF_JUST_FILES)) {
|
||||
Free(de.full_name);
|
||||
*_q++=Cluster2Blk(dv,de.cluster);
|
||||
*_q++=Clus2Blk(dv,de.clus);
|
||||
CatPrint(menu_ptr,"0. Old Boot Record\n\r");
|
||||
j++;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public Bool BootMHDIns(U8 drv_let,U8 *drv_lst=NULL)
|
||||
else {
|
||||
Free(de.full_name);
|
||||
*BMHD_BLK_CNT(U16 *)=(size+BLK_SIZE-1)>>BLK_SIZE_BITS;
|
||||
*BMHD_DAP_BLK(I64 *)=Cluster2Blk(dv,de.cluster);
|
||||
*BMHD_DAP_BLK(I64 *)=Clus2Blk(dv,de.clus);
|
||||
//Bypass partition bounds-checking
|
||||
BlkDevLock(bd);
|
||||
ATAReadBlks(bd,&mbr,0,1);
|
||||
|
||||
+18
-18
@@ -124,8 +124,8 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
|
||||
MemSet(buf,0,DVD_BLK_SIZE);
|
||||
}
|
||||
if (write) {
|
||||
FRBlks(in_file,buf,i<<2,n);
|
||||
FWBlks(out_file,buf,*_cur_blk<<2,n);
|
||||
FBlkRead(in_file,buf,i<<2,n);
|
||||
FBlkWrite(out_file,buf,*_cur_blk<<2,n);
|
||||
}
|
||||
*_cur_blk+=1;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
|
||||
if (write)
|
||||
"%X:%s\n",*_cur_blk,tmpde->full_name;
|
||||
if (write)
|
||||
FWBlks(out_file,dir_blk_buf,*_cur_blk<<2,n<<2);
|
||||
FBlkWrite(out_file,dir_blk_buf,*_cur_blk<<2,n<<2);
|
||||
*_cur_blk+=n;
|
||||
|
||||
tmpi2->len=sizeof(CISO1DirEntry)-1;
|
||||
@@ -212,7 +212,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
|
||||
if (write)
|
||||
"%X:%s\n",*_cur_blk,tmpde->full_name;
|
||||
if (write)
|
||||
FWBlks(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2);
|
||||
FBlkWrite(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2);
|
||||
*_cur_blk+=n;
|
||||
|
||||
Free(dir_blk_buf);
|
||||
@@ -328,7 +328,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
|
||||
if (!_filename)
|
||||
_filename=blkdev.dft_iso_filename;
|
||||
filename=DftExt(_filename,"ISO");
|
||||
filename=ExtDft(_filename,"ISO");
|
||||
|
||||
if (_stage2_filename)
|
||||
stage2_filename=FileNameAbs(_stage2_filename);
|
||||
@@ -367,7 +367,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
goto cf_done;
|
||||
|
||||
while (cur_blk<20<<2>>2)
|
||||
FWBlks(out_file,zero_buf,cur_blk++<<2,4);
|
||||
FBlkWrite(out_file,zero_buf,cur_blk++<<2,4);
|
||||
|
||||
iso_pri->type=ISO1T_PRI_VOL_DESC;
|
||||
StrCpy(iso_pri->id,"CD001");
|
||||
@@ -407,7 +407,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
et->sect_cnt=4; //5 seems like the limit, 4 is safer
|
||||
et->load_rba=cur_blk+1;
|
||||
"%X: Pre Boot Blk\n",cur_blk;
|
||||
FWBlks(out_file,et,cur_blk++<<2,4);
|
||||
FBlkWrite(out_file,et,cur_blk++<<2,4);
|
||||
"%X: Boot Stage 1\n",cur_blk;
|
||||
cur_blk+=DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE;
|
||||
}
|
||||
@@ -434,10 +434,10 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
for (i=1;i<=max_depth;i++)
|
||||
DVDFillPathTable(headdir,&itabbuf,&itabbuf2,1,FALSE,&first_free,1,i);
|
||||
"%X: Path Table 0\n",cur_blk;
|
||||
FWBlks(out_file,tabbuf,cur_blk<<2,tabsize<<2);
|
||||
FBlkWrite(out_file,tabbuf,cur_blk<<2,tabsize<<2);
|
||||
cur_blk+=tabsize;
|
||||
"%X: Path Table 1\n",cur_blk;
|
||||
FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
|
||||
FBlkWrite(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
|
||||
cur_blk+=tabsize2;
|
||||
|
||||
MemSet(tabbuf,0,tabsize*DVD_BLK_SIZE);
|
||||
@@ -458,35 +458,35 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
for (i=1;i<=max_depth;i++)
|
||||
DVDFillPathTable(headdir,&itabbuf,&itabbuf2,1,TRUE,&first_free,1,i);
|
||||
"%X: Path Table 2\n",cur_blk;
|
||||
FWBlks(out_file,tabbuf,cur_blk<<2,tabsize<<2);
|
||||
FBlkWrite(out_file,tabbuf,cur_blk<<2,tabsize<<2);
|
||||
cur_blk+=tabsize;
|
||||
"%X: Path Table 3\n",cur_blk;
|
||||
FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
|
||||
FBlkWrite(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
|
||||
cur_blk+=tabsize2;
|
||||
|
||||
DirTreeDel2(headdir);
|
||||
FillU32Palindrome(&iso_pri->vol_space_size,cur_blk);
|
||||
FillU32Palindrome(&iso_sup->vol_space_size,cur_blk);
|
||||
FWBlks(out_file,iso_pri,16<<2,4);
|
||||
FBlkWrite(out_file,iso_pri,16<<2,4);
|
||||
|
||||
iso_term->type=ISO1T_TERMINATOR;
|
||||
StrCpy(iso_term->id,"CD001");
|
||||
iso_term->version=1;
|
||||
if (stage2_filename) {
|
||||
FWBlks(out_file,iso_boot,17<<2,4);
|
||||
FWBlks(out_file,iso_sup,18<<2,4);
|
||||
FWBlks(out_file,iso_term,19<<2,4);
|
||||
FBlkWrite(out_file,iso_boot,17<<2,4);
|
||||
FBlkWrite(out_file,iso_sup,18<<2,4);
|
||||
FBlkWrite(out_file,iso_term,19<<2,4);
|
||||
stage2_size=(Size(stage2_filename,"+s")+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
||||
MemCpy(stage1_buf,BDVD_START,BDVD_END-BDVD_START);
|
||||
*(BDVD_BLK_CNT-BDVD_START+stage1_buf)(U16 *)=stage2_size;
|
||||
*(BDVD_BLK_LO -BDVD_START+stage1_buf)(U32 *)=stage2_blk;
|
||||
"$$RED$$!!! Boot Stage 2 !!! %X-%X$$FG$$\n",
|
||||
stage2_blk,stage2_blk+stage2_size-1;
|
||||
FWBlks(out_file,stage1_buf,
|
||||
FBlkWrite(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);
|
||||
FBlkWrite(out_file,iso_sup,17<<2,4);
|
||||
FBlkWrite(out_file,iso_term,18<<2,4);
|
||||
}
|
||||
|
||||
cf_done:
|
||||
|
||||
@@ -32,13 +32,13 @@ U0 RedSeaISO9660Stage1(U8 *iso_filename,U8 *stage2_filename)
|
||||
U8 *stage1_buf=CAlloc(DVD_BOOT_LOADER_SIZE);
|
||||
if (FileFind(stage2_filename,&de) && (out_file=FOpen(iso_filename,"wc+"))) {
|
||||
MemCpy(stage1_buf,BDVD_START,BDVD_END-BDVD_START);
|
||||
*(BDVD_BLK_LO -BDVD_START+stage1_buf)(U32 *)=de.cluster>>2;
|
||||
*(BDVD_BLK_LO -BDVD_START+stage1_buf)(U32 *)=de.clus>>2;
|
||||
*(BDVD_BLK_CNT -BDVD_START+stage1_buf)(U16 *)=
|
||||
(de.size+DVD_BLK_SIZE-1)>>(BLK_SIZE_BITS+2);
|
||||
*(BDVD_SHIFT_BLKS -BDVD_START+stage1_buf)(U16 *)=de.cluster&3;
|
||||
if (de.cluster&3)
|
||||
*(BDVD_SHIFT_BLKS -BDVD_START+stage1_buf)(U16 *)=de.clus&3;
|
||||
if (de.clus&3)
|
||||
*(BDVD_BLK_CNT -BDVD_START+stage1_buf)(U16 *)+=1;
|
||||
FWBlks(out_file,stage1_buf,
|
||||
FBlkWrite(out_file,stage1_buf,
|
||||
20<<2+1<<2,DVD_BOOT_LOADER_SIZE/BLK_SIZE);
|
||||
FClose(out_file);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
|
||||
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);
|
||||
FBlkWrite(out_file,zero_buf,i,4);
|
||||
|
||||
iso_pri->type=ISO1T_PRI_VOL_DESC;
|
||||
StrCpy(iso_pri->id,"CD001");
|
||||
@@ -70,7 +70,7 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
|
||||
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);
|
||||
FillU32Palindrome(&iso_pri->root_dir_record,dv->root_clus);
|
||||
iso_pri->file_structure_version=1;
|
||||
StrCpy(iso_pri->publisher_id,"TempleOS RedSea");
|
||||
|
||||
@@ -82,17 +82,17 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
|
||||
iso_boot->version=1;
|
||||
StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION");
|
||||
|
||||
FWBlks(out_file,iso_pri,16<<2,4);
|
||||
FBlkWrite(out_file,iso_pri,16<<2,4);
|
||||
iso_term->type=ISO1T_TERMINATOR;
|
||||
StrCpy(iso_term->id,"CD001");
|
||||
iso_term->version=1;
|
||||
|
||||
d=iso_boot(U8 *)+0x47;
|
||||
*d=20<<2>>2;
|
||||
FWBlks(out_file,iso_boot,17<<2,4);
|
||||
FBlkWrite(out_file,iso_boot,17<<2,4);
|
||||
|
||||
FWBlks(out_file,iso_sup,18<<2,4);
|
||||
FWBlks(out_file,iso_term,19<<2,4);
|
||||
FBlkWrite(out_file,iso_sup,18<<2,4);
|
||||
FBlkWrite(out_file,iso_term,19<<2,4);
|
||||
|
||||
et->w[0]=1;
|
||||
StrCpy(&et->w[2],"TempleOS");
|
||||
@@ -105,7 +105,7 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
|
||||
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);
|
||||
FBlkWrite(out_file,et,20<<2,4);
|
||||
FClose(out_file);
|
||||
}
|
||||
Free(zero_buf);
|
||||
@@ -147,7 +147,7 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
|
||||
else {
|
||||
if (!_iso_filename)
|
||||
_iso_filename=blkdev.dft_iso_c_filename;
|
||||
iso_filename=ChgExt(_iso_filename,"ISO.C");
|
||||
iso_filename=ExtChg(_iso_filename,"ISO.C");
|
||||
src_dir=DirNameAbs(_src_dir);
|
||||
if (_stage2_filename) {
|
||||
stage2_filename=FileNameAbs(_stage2_filename);
|
||||
|
||||
@@ -63,7 +63,7 @@ I64 SizeRep1(CDirEntry *tmpde,I64 *_fuf_flags)
|
||||
else if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
||||
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
|
||||
dv=Let2Drv(*tmpde->full_name);
|
||||
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
|
||||
BlkRead(dv,buf,Clus2Blk(dv,tmpde->clus),1);
|
||||
i=(&buf)(CArcCompress *)->expanded_size;
|
||||
}
|
||||
tmpde->user_data=i;
|
||||
|
||||
@@ -71,7 +71,7 @@ I64 BlkDevsSize()
|
||||
j=(bd->max_blk+1)<<BLK_SIZE_BITS;
|
||||
if (bd->type==BDT_RAM)
|
||||
"RAMDsk %C\t:%010X/%010X\n",
|
||||
bd->first_drv_let,j-UnusedDrvSpace(bd->first_drv_let),j;
|
||||
bd->first_drv_let,j-DrvUnused(bd->first_drv_let),j;
|
||||
res+=MSize2(bd->dev_id_record);
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
||||
|
||||
"HashTable\t:%010X\n",HashTableSize2(task->hash_table);
|
||||
"FPU\t\t:%010X\n",MSize2(task->fpu_mmx);
|
||||
"CurDir\t:%010X\n",MSize2(task->cur_dir);
|
||||
"DirCur\t:%010X\n",MSize2(task->cur_dir);
|
||||
|
||||
if (pdoc=DocPut(task))
|
||||
"PutDoc\t:%010X\n",DocSize(pdoc);
|
||||
@@ -172,7 +172,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
||||
"DskCache\t:%010X\n",
|
||||
MSize2(blkdev.cache_base)+MSize2(blkdev.cache_hash_table)+
|
||||
MSize2(blkdev.cache_ctrl);
|
||||
"Clipboard\t:%010X\n",DocSize(sys_clipboard_doc);
|
||||
"Clip\t:%010X\n",DocSize(sys_clip_doc);
|
||||
"AutoComplete:%010X\n",CallExtStr("AutoCompleteSize");
|
||||
"gr.to_8_bits\t:%010X\n",MSize2(gr.to_8_bits);
|
||||
"gr.to_8_colors\t:%010X\n",MSize2(gr.to_8_colors);
|
||||
|
||||
@@ -14,9 +14,9 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
|
||||
I64 i,j,cnt=0,res;
|
||||
|
||||
if (!_in_name) return 0;
|
||||
in_name=DftExt(_in_name,"DD.Z");
|
||||
in_name=ExtDft(_in_name,"DD.Z");
|
||||
if (_out_name)
|
||||
out_name=DftExt(_out_name,"DD.Z");
|
||||
out_name=ExtDft(_out_name,"DD.Z");
|
||||
else
|
||||
out_name=StrNew(in_name);
|
||||
|
||||
|
||||
@@ -112,11 +112,11 @@ public U0 ToTXT(U8 *_in_name,U8 *_out_name=NULL,I64 width=70)
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
WinHorz(0,width-1); //Sets doc width for word wrap.
|
||||
|
||||
in_name=DftExt(_in_name,"DD.Z");
|
||||
in_name=ExtDft(_in_name,"DD.Z");
|
||||
if (_out_name)
|
||||
out_name=DftExt(_out_name,"TXT");
|
||||
out_name=ExtDft(_out_name,"TXT");
|
||||
else
|
||||
out_name=ChgExt(_in_name,"TXT");
|
||||
out_name=ExtChg(_in_name,"TXT");
|
||||
|
||||
doc_in=DocRead(in_name);
|
||||
doc_out=Doc2TXT(doc_in);
|
||||
|
||||
@@ -10,7 +10,7 @@ public CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0)
|
||||
if (!task) task=Fs;
|
||||
if (!TaskValidate(task)) return NULL;
|
||||
tmpse=CAlloc(sizeof(CTaskSettings),task);
|
||||
tmpse->cur_dir=CurDir(task,task);
|
||||
tmpse->cur_dir=DirCur(task,task);
|
||||
tmpse->draw_it=task->draw_it;
|
||||
GrPaletteGet(tmpse->palette);
|
||||
tmpse->task_end_cb=task->task_end_cb;
|
||||
|
||||
@@ -343,6 +343,7 @@ ext[EXT_WIN_TO_TOP]=&WinToTop;
|
||||
|
||||
public CTask *WinFocus(CTask *task=NULL)
|
||||
{//Set task as focus task.
|
||||
if (!task) task=Fs;
|
||||
PUSHFD
|
||||
CLI
|
||||
if (!TaskValidate(task)||Bt(&task->win_inhibit,WIf_SELF_FOCUS))
|
||||
|
||||
+8
-18
@@ -2,7 +2,7 @@
|
||||
|
||||
public U0 Refresh(I64 cnt=1,Bool force=FALSE)
|
||||
{//Wait for 30fps WinMgr to start & finish scrn refresh.
|
||||
//0,FALSE Cnt Sync to WinMgr. (not used)
|
||||
//0,FALSE Cnt Sync to WinMgr. (not used)
|
||||
//0,TRUE Pump Msgs.
|
||||
//1 Cnt Wait and Pump Msgs.
|
||||
//2 Cnt Make Sure to do a Full Refresh
|
||||
@@ -14,20 +14,16 @@ public U0 Refresh(I64 cnt=1,Bool force=FALSE)
|
||||
if (!cnt&&force)
|
||||
LBts(&sys_semas[SEMA_JUST_PUMP_MSGS],0);
|
||||
while (Bt(&sys_semas[SEMA_REFRESH_IN_PROGRESS],0)) {
|
||||
if (force) {
|
||||
LBts(&sys_semas[SEMA_FORCE_WINMGR],0);
|
||||
if (sys_winmgr_task) sys_winmgr_task->wake_jiffy=cnts.jiffies;
|
||||
}
|
||||
if (force && sys_winmgr_task)
|
||||
sys_winmgr_task->wake_jiffy=cnts.jiffies;
|
||||
Yield;
|
||||
}
|
||||
if (cnt>1 && old_doc)
|
||||
old_full_refresh=LBts(&old_doc->flags,DOCf_DO_FULL_REFRESH);
|
||||
update_cnt=winmgr.updates+cnt;
|
||||
while (winmgr.updates<update_cnt) {
|
||||
if (force) {
|
||||
LBts(&sys_semas[SEMA_FORCE_WINMGR],0);
|
||||
if (sys_winmgr_task) sys_winmgr_task->wake_jiffy=cnts.jiffies;
|
||||
}
|
||||
if (force && sys_winmgr_task)
|
||||
sys_winmgr_task->wake_jiffy=cnts.jiffies;
|
||||
Sleep(1);
|
||||
}
|
||||
if (old_doc)
|
||||
@@ -281,16 +277,10 @@ I64 WinMgrSleep(Bool flush_msgs=FALSE)
|
||||
music.cur_song_task=NULL;
|
||||
}
|
||||
winmgr.updates++;
|
||||
if (!ms_hard.install_attempts)
|
||||
SleepUntil(timeout_val); //Just for before mouse install attempt at boot.
|
||||
else
|
||||
do {
|
||||
KbdMsHndlr(FALSE,TRUE);
|
||||
SleepUntil(MinI64(timeout_val,cnts.jiffies+JIFFY_FREQ/500));
|
||||
} while (cnts.jiffies<timeout_val &&
|
||||
!Bt(&sys_semas[SEMA_FORCE_WINMGR],0));
|
||||
if (ms_hard.install_attempts) //Don't call before boot mouse install attempt
|
||||
KbdMsHndlr(FALSE,TRUE);
|
||||
SleepUntil(timeout_val);
|
||||
}
|
||||
LBtr(&sys_semas[SEMA_FORCE_WINMGR],0);
|
||||
return msg_code;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user