TempleOSCDV5.00.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:48:09 +02:00
1 parent 122df6338e
commit f6eacf7744
374 files changed
+11078 -11204

No files matched your search

+13 -13
View File
@@ -566,14 +566,14 @@ U0 FMRightClick()
}
}
U8 *fm_ip_str=NULL;
U8 *fm_ms_str=NULL;
U0 (*fp_old_final_scrn_update)(CDC *dc);
U0 FMFinalScrnUpdate(CDC *dc)
{
if (fm_ip_str) {
if (fm_ms_str) {
dc->color=LTRED;
GrPrint(dc,ip.pos.x,ip.pos.y,"%s",fm_ip_str);
GrPrint(dc,ms.pos.x,ms.pos.y,"%s",fm_ms_str);
}
(*fp_old_final_scrn_update)(dc);
}
@@ -581,7 +581,7 @@ U0 FMFinalScrnUpdate(CDC *dc)
public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
{//File manager. Also, used to choose files and dirs.
CDirEntry *head=NULL,*tmpde,*tmpde1,*tmpde2;
I64 sc,ch,a1,a2,msg_code;
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;
CDocEntry *doc_ce=NULL,*doc_e;
@@ -600,26 +600,26 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
}
do {
DocUnlock(doc);
do msg_code=GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN|1<<MSG_IP_L_UP|
1<<MSG_IP_R_UP);
do msg_code=GetMsg(&arg1,&arg2,
1<<MSG_KEY_DOWN|1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|1<<MSG_MS_R_UP);
while (Fs!=sys_focus_task);
DocLock(doc);
switch (msg_code) {
case MSG_IP_R_UP:
case MSG_MS_R_UP:
DocUnlock(doc);
FMRightClick;
DocLock(doc);
break;
case MSG_IP_L_DOWN:
case MSG_MS_L_DOWN:
doc_ce=doc->cur_entry;
fm_ip_str=doc_ce->tag;
fm_ms_str=doc_ce->tag;
gr.fp_final_scrn_update=&FMFinalScrnUpdate;
break;
case MSG_IP_L_UP:
case MSG_MS_L_UP:
if (doc_ce) {
gr.fp_final_scrn_update=fp_old_final_scrn_update;
if (WinCursorPosSet(Fs,a1+Fs->pix_left+Fs->scroll_x,
a2+Fs->pix_top+Fs->scroll_y,TRUE)) {
if (WinCursorPosSet(Fs,arg1+Fs->pix_left+Fs->scroll_x,
arg2+Fs->pix_top+Fs->scroll_y,TRUE)) {
doc_e=doc->cur_entry;
if (doc_e!=doc_ce) {
st2=NULL;
@@ -678,7 +678,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
break;
case MSG_KEY_DOWN:
doc_ce=NULL;
ch=a1; sc=a2;
ch=arg1; sc=arg2;
if (sc.u8[0]==SC_DELETE && !(sc&(SCF_SHIFT|SCF_CTRL)))
ch=CH_CTRLY;
if (ch && sc&SCF_ALT) goto fm_regular_key;
+29 -18
View File
@@ -1,13 +1,14 @@
#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);"
I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
U8 Mount2(U8 boot_drv_let,CDoc *_doc,Bool _caller_is_prtdsk)
{//If _doc, called by $LK,"::/Kernel/KCfg.HC"$ else called by $LK,"Mount",A="MN:Mount"$().
I64 cnt,res=0,num_hints,drv_let,type,unit;
I64 cnt,total=0,num_hints,drv_let,type,unit,prt_num;
U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN],
*filename=NULL,*filename2=NULL;
*filename=NULL,*filename2=NULL,res=0;
CATARep *head=NULL,*tmpha;
Bool one_drv,make_free;
Bool whole_drv,make_free;
CDoc *doc;
boot_drv_let=ToUpper(boot_drv_let);
if (boot_drv_let)
boot_drv_let=Let2Let(boot_drv_let);
do {
cnt=0;
if (!_doc)
@@ -19,10 +20,10 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
"$$GREEN$$Q$$FG$$-$$GREEN$$S$$FG$$ are ISO file write drives.\n"
"$$GREEN$$T$$FG$$-$$GREEN$$Z$$FG$$ are ATAPI CD/DVD drives.\n"
"\nDrive Letter ($$PURPLE$$<ENTER>$$FG$$ to exit):";
drv_let=ToUpper(GetChar);
drv_let=Let2Let(GetChar);
'\n';
if (type=Let2BlkDevType(drv_let)) {
one_drv=FALSE;
whole_drv=FALSE;
if (_doc) { //Called by $LK,"::/Kernel/KCfg.HC"$
doc=_doc;
make_free=FALSE;
@@ -32,6 +33,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
make_free=TRUE;
}
unit=0;
prt_num=MIN_I64;
switch (type) {
case BDT_RAM:
"Addr of RAM disk ($$PURPLE$$<ENTER>$$FG$$ to MAlloc):";
@@ -44,6 +46,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
filename=GetStr("File Name:");
break;
case BDT_ATA:
prt_num=GetI64("Partition Num (Default=All):",prt_num);
case BDT_ATAPI:
num_hints=ATARep(,,&head);
if (type==BDT_ATAPI && boot_drv_let)
@@ -87,6 +90,8 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
case BDT_ISO_FILE_WRITE:
if (!*blks_buf) StrCpy(blks_buf,"0");
DocPrint(doc,"bd->max_blk=(%s)-1;\n",blks_buf);
DocPrint(doc,"bd->drv_offset=19<<2+"
"(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;\n");
break;
case BDT_ISO_FILE_READ:
filename2=FileNameAbs(filename);
@@ -102,31 +107,37 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
make_free=TRUE;
} else
DocPrint(doc,"bd->base0=%s;bd->base1=%s;\n",base0_buf,base1_buf);
if (type==BDT_ATA && repartition) {
if (type==BDT_ATA && _caller_is_prtdsk) {
"\nReformat WHOLE drive!";
one_drv=YorN;
whole_drv=YorN;
}
break;
}
DocPrint(doc,"BlkDevAdd(bd,%d,%d);\n",one_drv,make_free);
DocPrint(doc,"BlkDevAdd(bd,%d,%d,%d);\n",prt_num,whole_drv,make_free);
if (_doc) //Called by $LK,"::/Kernel/KCfg.HC"$
cnt++;
else { //Called by $LK,"Mount",A="MN:Mount"$()
if ((cnt=ExeDoc(doc)) && one_drv)
PrtDsk(drv_let);
if ((cnt=ExeDoc(doc)) && whole_drv) {
if (_caller_is_prtdsk) {
res=drv_let;
PrtDsk(drv_let,1.0); //First mount whole drive.
} else
PrtDsk(drv_let);
}
DocDel(doc);
}
}
res+=cnt;
} while (cnt || !res && _doc); //At least 1 if Called by $LK,"::/Kernel/KCfg.HC"$
total+=cnt;
} while (cnt && !_caller_is_prtdsk ||
!total && _doc); //At least 1 if Called by $LK,"::/Kernel/KCfg.HC"$
Free(filename);
Free(filename2);
return res;
}
public I64 Mount(Bool repartition=FALSE)
{//Mount drives.
return Mount2(0,NULL,repartition);
public U8 Mount(Bool caller_is_prtdsk=FALSE)
{//Mount drives. Called from $LK,"PrtDsk(Mount)",A="FF:::/Adam/ABlkDev/PrtDsk.HC,Mount("$.
return Mount2(0,NULL,caller_is_prtdsk);
}
public U0 Unmount(U8 drv_let=0)
@@ -141,7 +152,7 @@ public U8 MountFile(U8 *filename)
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;
bd->file_dsk_name=AStrNew(filename3);
BlkDevAdd(bd,TRUE,TRUE);
BlkDevAdd(bd,,TRUE,TRUE);
Free(filename3);
Free(filename2);
return dv->drv_let;
+28 -24
View File
@@ -10,20 +10,20 @@ class CPlannedDrv
Bool pri;
};
//Available to assist in writing scripts.
I64 drv_dsk_dsk_size=0;
public I64 PrtDsk(U8 drv_let=0,...)
{/*Partition the disk containing partition drv_let.
public I64 PrtDsk(U8 drv_let=0)
{//Partition the disk containing partition drv_let.
//drv_let=0 means add new drive that
//is not already mounted.
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.
*/
CBlkDev *bd;
CPlannedDrv head,*tmppp;
CMasterBoot mbr;
Bool pri=TRUE;
I64 ext_base,drv_let2,pri_cnt=0,
i,start_offset,offset,remaining;
drv_dsk_dsk_size=0;
I64 ext_base,drv_let2,pri_cnt=0,i,start_offset,offset,
total,remaining,cur_arg=0;
"This command does not play well\n"
"with other operating systems.\n"
"You really should use another\n"
@@ -34,17 +34,17 @@ public I64 PrtDsk(U8 drv_let=0)
"until you set block zero to zero\n"
"with $$LK,\"BootMHDZero\",\"MN:BootMHDZero\"$$()\n\n\n"
"Continue";
if (!YorN) return 0;
if (argc<=cur_arg && !YorN)
return 0;
'\n';
if (drv_let && !Let2BlkDev(drv_let,FALSE))
drv_let=0;
if (!drv_let) {
Mount(TRUE);
return 0;
}
if (!(bd=Let2BlkDev(drv_let,FALSE)) || bd->type!=BDT_ATA)
if (!drv_let && !(drv_let=Mount(TRUE)) ||
!(bd=Let2BlkDev(drv_let,FALSE)) || bd->type!=BDT_ATA)
return 0;
drv_dsk_dsk_size=bd->max_blk+1;
total=bd->max_blk+1;
QueInit(&head);
drv_let2=bd->first_drv_let;
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO);
@@ -55,7 +55,7 @@ public I64 PrtDsk(U8 drv_let=0)
tmppp->pri=FALSE;
if (pri) {
"Primary Partition";
if (YorN) {
if (argc>cur_arg || YorN) {
pri_cnt++;
tmppp->pri=TRUE;
if (pri_cnt==3)
@@ -63,10 +63,14 @@ public I64 PrtDsk(U8 drv_let=0)
} else
pri=FALSE;
}
"Blocks Remaining:%d (0x%X)\n",
"\nBlocks Remaining:%d (0x%X)\n",
remaining-DRV_HEADER,remaining-DRV_HEADER;
tmppp->size=CeilU64(GetI64("Size in Blocks :",
remaining-DRV_HEADER)+DRV_HEADER,ROUND_DRV_TO);
if (argc>cur_arg)
tmppp->size=MinI64(CeilU64(MaxI64(remaining,DRV_HEADER),ROUND_DRV_TO),
CeilU64(argv[cur_arg++](F64)*total,ROUND_DRV_TO));
else
tmppp->size=CeilU64(GetI64("Size in Blocks :",
remaining-DRV_HEADER)+DRV_HEADER,ROUND_DRV_TO);
} while (!(ROUND_DRV_TO<=tmppp->size<=FloorU64(remaining,ROUND_DRV_TO)));
QueIns(tmppp,head.last);
remaining-=tmppp->size;
@@ -85,7 +89,7 @@ public I64 PrtDsk(U8 drv_let=0)
tmppp=tmppp->next;
drv_let2++;
}
if (!AreYouSure)
if (!argc && !AreYouSure)
goto pd_done;
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO)-ROUND_DRV_TO;
@@ -149,15 +153,15 @@ public I64 PrtDsk(U8 drv_let=0)
}
bd->flags&=~(BDF_INITIALIZED | BDF_INIT_IN_PROGRESS);
BlkDevAdd(bd,FALSE,TRUE);
BlkDevAdd(bd,,FALSE,TRUE);
for (i=bd->first_drv_let;i<drv_let2;i++)
Fmt(i,,FALSE);
pd_done:
pd_done:
while (head.next!=&head) {
tmppp=head.next;
QueRem(tmppp);
Free(tmppp);
}
return drv_dsk_dsk_size;
return total;
}